Rules

This is a working group for people interested in the rules module.

The group serves as a place to discuss new features and possible use cases of the rules module in drupal.
Furthermore it's used to announce recent developments related to the group.

Check the developer's blog for rules related news.
Read and help improving the documentation.

Assign values to individual elements of multivalued field

How do I assign values to individual elements of a multivalued field with Rules? I know how to assign a value to a single valued field with the "Populate a field" action. This does not work for a multivalued field, as I want to assign a value to specific fields in the array.

I tried to use custom PHP code following the suggestion under the code entry box:

Expected format:
return array(
0 => array('nid' => value for nid),
// You'll usually want to stop here. Provide more values
// if you want your 'default value' to be multi-valued:
1 => array('nid' => value for nid),

Login to post comments · Read more

Create node and copy fields

I have two content types: Request and Response. When Request reaches a certain state in its Workflow, Response is created. At this point, some fields from the Request are copied to the Response. The field types include Integer, Text, File, Date and User Reference. I can see two potential solutions here:

1) Create a node of type Response and copy the field values there.
There is an Action that creates a Node. But I could not find an easy way to copy the field values into this new Node.

2) Clone Request and convert one of the copies into Response.

Login to post comments · Read more

Populate revision information field on edit

Our content contributors are not very good at populating the revision information field (Drupal 6).
On node edit, I would like to auto-populate a revision field with the editor's user name.
As an alternative, I have looked into Views 2 but it is not clear how I can retrieve the user name of the last person to save a node.

How would I go about implementing such a rule in Rules?

Login to post comments

A Issue in displaying the data while using Rules - Module

Hi,
I am using rules module to set a trigger for an action with "Execute Custom PHP code" My code

Login to post comments · Read more

Accessing CCK field in Execute Custom PHP Code

Hi everybody,

Here's what I'm trying to do: When the user submits a custom CCK content type (Newsletter), I have a rule setup to access one of its fields (field_pdf, a path to the associated pdf file), and generate a thumbnail from the file's front page. Here's what I've got so far:

Event: After saving new content
IF: Content is Newsletter
DO: Execute custom PHP code

However, in the PHP Code block of the Execute Custom PHP Code page, it is not obvious to me how I reference my content's field_pdf variable.

generateThumbnail(?????????);

How do I access that field?

1 comment

Rules >> Triggered Rules >> Check the Content has Access (example: book access, forum access)

As the title suggests, I am trying to use the rules module to check Access Control.

Login to post comments · Read more

Replacing workflow modules

I currently use workflow as part of publishing workflow. A user can keep a node "unpublished". Its drupal status is published but has a workflow status "unpublished" to make sure it does not show.
Now workflow-NG is suppsoed to be successor of workflow and rules are supposed to be successor of workflow-ng.

2 comments · Read more

Moderation email

hello

Thanks for great module. I have small question because I don't know if this is possible to do with rules.
So what I would like to do.
So I have some kind of content type where registered users can add new node. But I would like to do 3 things with this
1. Show a message for the user that his/her node is added and wait for moderation.
2. Unpublish this created content
3. Send an email to moderator with information who and what added and with links to moderate actions like
Publish node - Edit node - Delete node

Login to post comments · Read more

Modify the Theme after the user login or set user default theme on registration. How to?

Hi,

I am new to Rules.

I would like to change Theme after the user login. In my web site, the user cannot change the theme.

In my mind, I have two choices:

1) Modify the Theme after the user login
2) set user default theme on registration.

Could this be done by Rules? We all know that we have the trigger "after a user login". Therefore, my main question is how to create the Action? Is it a must to write some PHP code?

Thanks.

hosais

Login to post comments

create trigger for rules to publish when user is added to group

Hi there,

I'm trying to do something that i thought would be fairly easy using rules, which is:
- publish a users content when user has role 'paid_member'. I cant use any on the existing triggers (such as 'on save new content) as they rely on the user clicking on the page to make the publishing process happen. To go with this i would need to create user driver triggers such as 'when saving new content' and role = 'paid member' then publish otherwise any new content they create wont get published.

Login to post comments · Read more

Perform task for all nodes of a certain type

Hi,

I want to perform a task for all nodes of a certain type.

Can I do this with Rules?

Who can give me a hint how to do this.

thanks
Fred

Login to post comments

How to create custom message to user after rule has triggered?

Hi,
I need to show a custom page to the user after a node has been created. The page needs to reflect the new node, so I need to pass some data to the page (e.g., the nid or some extracted data from the node).

What is the best way to achieve this? I'm no Drupal expert, so I have a feeling I've missed something basic here... :)

1 comment · Read more
arphaus's picture

Can Rules be used for gradual content delivery on a per-user basis?

I'd like each member of a site to receive access to nodes of a specific content type based on their length of membership. For example, I have 4 nodes of content type X, and I'd like members to access them in 2 week intervals, like so:

Day 1: Member A joins, sees node #1
Day 15: Member A sees node #1 & #2
Day 29: Member A sees #1 #2 & #3; Member B joins and sees node #1 ONLY
Day 43: Member A sees all 4 nodes; Member B sees node #1 & #2 only

5 comments · Read more

Is Rule Module, the right solution for my problem?

Hi,
I have posted my issue in the forum and I was told by someone that Rule module can be a good choice for my solution, so I am here to know if its really the case.

What I am doing?
I have content type named "images" where registered user can only create one node.
I am using node limit module to control the content type "images"

What is the Problem?

6 comments · Read more
Rosamunda's picture

Save a new node and then goto add node again + if I´m editing a node, disable specific cck fields... can I do those things with rules??

Hi there!
I´ve postad a support question at the issue queue of rules, but I think that maybe here I can get some help.
I need to know if these two things are "doable" with rules. If someone could guide me to actually do it, it would be great, but as I´m new with Rules, I need to know first if rules can do what I need:

1.

3 comments · Read more

Rules, Content Profile and User Reference

I am using the Content Profile module in order to assign users from a "Sales Rep" role to users in a "Dealer" role. I'm then using Rules to send email notifications triggered on the creation of certain node types. What I'd also like to do is be able to tell Rules to send that email to the Sales Rep associated with the author of the node. Is it possible to use Rules to send emails to this Referenced User using this method? I'm unable to get it to work.

Login to post comments · Read more

Rules to handle sign-ups to bookable training courses

Hi Rules people and fans,

I'm looking for advice, ideas and pointers regarding the following scenario that I'm looking to "solve" using rules.

The website in question is for a training company who runs bookable public courses in a variety of different subjects. As an aside, the combination of Signup, Signup Status, UC Signup and UberCart provides some of the functionality that we're looking for, but not all. Here's what we want to do:

  1. Allow people to "sign up" for a training event (don't have to use the Signup suite of modules for this if there is a better way),
1 comment · Read more

Use rules to block specific field entries?

I'm fairly new to rules, but I've used it successfully to add a ton of great features to my site -- great module!

Now I'm trying to figure out if there's a way I can use Rules as part of a reservation system I created. Basically, I'm trying to create a rule that will disallow users from reserving equipment on a date if someone else has already reserved the equipment for that date. Is this possible with rules? Any ideas for ways I might test it out?

Any help is much appreciated. Thanks!

Login to post comments

Delete Orphaned Terms with rules

hello

is it possible to check cron.php driven for orphaned terms and delete them out of the box?
did somebody already configured something like this?
if not: has somebody an idea which would be the ideal locations (actions, triggers,conditions) where i have to write a short php snippet?

thanks momper

Login to post comments
Shane Birley's picture

Userpoints, Rules, and Taxonomy (Oh, My!)

I have been trying to use the Rules module to grant points to a user based upon the taxonomy term used for organizing points. I have been successful at granting points to the user but it always adds the points to the first term in the vocabulary and no matter what order I load the user id and term id into the rule, it always seems to ignore the term id.

I assume I am doing something completely wrong and am hoping someone can point at me and say: "Did you click the, blah blah?" Any help would be awesome, thanks!

If I solve it, I will post back here.

Login to post comments
Syndicate content