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.

How can I make "on publish" be a trigger?

Hi there,

I was reading and almost happy to find http://groups.drupal.org/node/97454 but it seems to be for drupal 6.

I am trying to accomplish the same but then for drupal 7

I am using module scheduler to publish content .. and i cannot figure out how i can have rules detect that when the scheduled content is published to take certain actions (email members that want to be notified when new content is published)

5 comments · Read more
BrightBold's picture

Adding data value inside a loop

I'm surprised I cant' find this documented anywhere, so I'm hoping someone here can point me in the right direction. I'm trying to set up functionality using OG and Rules where a project manager can close out a group at the end of a project, and as a result new fields would be revealed on the group content and different Views would show on the Group page. I was thinking to do this, I'd want the group content nodes to inherit the "closed" status when the project group is marked closed.

So I created the following rule:

Event:
After updating existing content

Conditions:

1 comment · Read more
Ayesh's picture

VBO and Rules - Rules doesn't grab modified CCK field's values

Hello everyone,
I've setup a Views Bulk Operation page to modify a CCK number field on multiple nodes. Also I have a Rule set, on event "after updating existing content".

I want to update another (number)field in the modified node as soon as I update this CCK number field.

When I change the value of the CCK field using VBO, the Rule actually triggers. But it grabs the value of unchanged content. I'm already using tokens of "Saved content"
If I save the content again (Using VBO-provided "Save node" action), now Rule grabs new value.

2 comments · Read more

Change taxonomy term after a duration

Hi

I'm looking for a while a way to change term of a content after an elapsed time.In my ming , it could be great to give the choice of duration to user.
So user create a content and choose a term to highlight the content on homepage for a choosing duration (he can choose a date or a duration).
After that this is my rules idea but need correction i think.

1-create a ruleset "Duration of content and term" with argument on content, date, term
2- create a rule into ruleset with actions:
=> Charge taxonomy term : the new one
=> Charge taxonomy term : the actual one

2 comments · Read more
killer-br's picture

How scheduler can access other kind of content type

Hi, friends.

I have a content type called ticket (in Drupal 7). One of its fields is STATUS.

When some user changes the status to SOLVED, RULES sends an email to another person.
This person has up to 2 days to change the status to CLOSED.
If not, the system (RULES) will change to CLOSED.

The problem is:

When I am creating a new component of scheduler, there is no option to select data from TICKET.
In the the block "variables", Data type doesn't show TICKET.
If I set the action to "SET A VALUE"... Nothing about TICKET.

Yeah, I am a newbie.

1 comment · Read more

How to avoid a rule reacting on a passed date.

I have managed to get my rule to react on info from a date field placed in every user profile.

The thing is, if the date put in the date field is already passed, the rule will fire right away - even if the date is years ago.

In this case a user fills out the date of his sons birth. Let’s say the date is 1. January and the offset is 5 days and he fills out the date field today, the rule will react right away, because the date has passed, and the user will get a mail there no longer is of any importance to him.

So how do I avoid my rule reacting on dates that has already passed?

5 comments · Read more

"create new content" blank nodes - help!

I am using "create new content" so that I can save a special node ref from the "current content" to another content type that exists on the system. I hope that this is the best way of writing nodes for any other content type outside of the current "created content"!

This is what I do:
1) I do an action to create "new content" assigned to my other content type;

1 comment · Read more
NonProfit's picture

How to Flag a created entity via Rules

Hi, Looking for help using Flag and Rules.

Once an even fires, I'd like a node to be created and for the created node to be flagged.

Currently:

 The rule properly creates the node.
 The flag can be manually toggled on the new node.

The rule does not flag the new node.

Initially I thought the data selector should be entity-created. I then attempted to fetch the entity [entity-created:type] and flag [entity-fetched:0]. Again, no love.

Any assistance on how to flag a created entity would be appreciated.

3 comments

Rules - Data Comparison

Hi,

I have a problem with the data compare condition and cannot seem to find a way to do it.

What I want : To create a rule which will compare the data entered via a text(current entry) with the same values already present in other nodes(old entries).
eg : Id : 6 ------- this is the value(data) the user adds in the page he is filling up before he hits a submit/save button
the rule should check if some other user has added the same value(6) for the same field(Id) of other nodes that were created initially.

Please help
Thanks!

1 comment
mahiljasani's picture

Getting error when using 'load a user list with views' action in rules bonus pack in drupal7

Hi All,

I am getting this error when using "load a user list with views" action in rules bonus pack in drupal7

Notice: Undefined property: view::$field in rb_views_create_view_representation() (line 82 of C:\wamp\www\drupal-7.10\sites\all\modules\rb\rb_views.module).
Warning: array_keys() [function.array-keys]: The first argument should be an array in rb_views_create_view_representation() (line 82 of C:\wamp\www\drupal-7.10\sites\all\modules\rb\rb_views.module).

please let me know if any one knows about this.

Thanks,
Mahil Jasani

1 comment

Rules Scheduler and Content Access

Hi,
I'm working on a site where we are going to streaming live events. I have, with help from Commerceguys in this tutorial managed to sell access to nodes per user. So far so good.

My problem is that i want to be able to set a date on every premium node (e.g +1 day, fixed date). So if you buy a recorded event you're supposed to have access to the node for 24 h and if you buy a live event you will have access to it for a specific date/time.

1 comment · Read more

Latest created node won't delete, only previous one

I have controlled field that lets the user select from either the "all" global list of nodes of one CT or the "my" list of nodes (which would be a subset of the first type) in the form that saves data for the "Record" content type. In my Rule I do a couple of things: 1) I let the user save a "Record" node with the node ref of the "All" or "My" item and 2) If the user selects from the "all" list, I also add a unique node to the My list with the node ref of the item.

Login or register to post comments · Read more

Problems getting field value into custom php (Undefined index & Undefined offset errors)

I am trying to use the following php to take the url from Field A, clean it up, and save it to Field B.

If I put the domain in manualy the rule works just fine and saves somedomain.com to Field B

<?php

$myurl
= get_domain ('http://store.somedomain.com/cart/index.php');

function
get_domain ($url) {
$raw_url= parse_url($url);
preg_match ("/.([^\/]+)/", $raw_url['host'], $domain_only);
return
strtolower($domain_only[1]);
}

echo
$myurl;

?>

Login or register to post comments · Read more

User profile fields as conditions

I'm having a hard time exposing fields from the user entity to rules conditions.

I'm trying to create a rule to verify certain profile fields are filled out when a user tries to create content of type "event". My rule fires when saving a node, has a condition to check the content type... and then I'm stuck. I can't seem to get the user entity fields to appear in the data selector for "field is empty". I've added conditions:

  • site:current-user [entity is type = user]
  • site:current-user [entity has field = field_profile_firstname]
1 comment · Read more
killer-br's picture

My doubt: can rules do it?

Hi, folks.

I looking for a solution for this problem:

If five (or more) contents were created with a specific tag, I must do something (send an email, for example).

** Does RULES can control this for me?

I know RULES can control one content, but only if we reached five (or more) the automatic mechanism must send email. And then, no more.

If RULES can, so I will watch aaaaall screencasts produced generously by NodeOne team.

Thanks

Regards from Brazil,

Killer BR

6 comments
mahiljasani's picture

How to send emails to all referenced users in node. In Drupla 7

Hi All,

Not sure if this is the right place to ask this question. If any buddy knows that How to send emails to all referenced users in node using RULES module. For Drupal 7

Thanks in advance.

4 comments

Data comparison

I just got started with rules and I set up a simple data comparison but it does not work I have attached a screenshot.

Login or register to post comments · 1 attachment

Use Case: If node of certain taxonomy terms exist use as reference, if not create it first

I've searched for the answer to this question before asking here but I'm stumped. I also found a number of people with similar questions but no answers. I also posted this on stack exchange ...

http://drupal.stackexchange.com/questions/19059/rules-help-check-to-see-...

Here is my scenario;

Login or register to post comments · Read more

Sending out mails on specific dates

Hi everybody,

I hope you can give me a little guidance out in the world of Rules.

I would like to be able to send out individual emails to the users of my webpage. Each user will type in the date of his birth on his profile, and I would like for him to receive a mail not just on his birthday but also on other dates set by me. The mail will consist of a standard message determined by the amount of time since his birth. I could be a mail saying: “Today its 10.000 days since you were born – maby its time to go see a dentist”.

10 comments · Read more

Trigger a view bulk operation with Rules 2 and Drupal 7

I'm trying to trigger a simple view bulk operation (unpublish a batch of nodes) with Rules 2 and Drupal 7. I've been trying to add an action but only get exposed Load a list of entities from a VBO View while I'd be waiting for "Execute a VBO" or similar instead.

Is there anything I'm missing ?

2 comments · 1 attachment
Syndicate content