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.

Rules Monkey: Update #2

klausi's picture
private
groups: Rules · SoC 2009
klausi - Wed, 2009-07-01 15:49

This is the second update of the Rules Monkey Summer of Code project. I'm sorry for the relatively long pause between this post and the previous update (university kept my quite busy in June, but now I'm full-time available).

The progress that has been made so far:

  • Work on the Rules Scheduler issue (http://drupal.org/node/455560)
  • Successfully explored Views, DB-Schema and Rules hooks
  • Scheduled tasks can now be viewed, a Rules action is available to cancel specific scheduled tasks

Integrating Views into Rules

aantonop's picture
private
group: Rules
aantonop - Mon, 2009-06-29 18:40

Hello everyone,

I'm building a project/task management system on Drupal for my company.

I need to integrate Views into Rules. The general idea is the following:

I want to trigger a rule on cron and once a week send an "overview" to each member of a project showing their tasks, by email.

Rather than writing a gnarly PHP SQL kludge, I'd rather just work on some basic views integration. The basic idea is to create an rules action in the views module that allows me to render a specific view (perhaps passing arguments) and store the output.

Here's the integration plan:


Saving node, get saved title

private
group: Rules
aeronox - Mon, 2009-06-29 09:59

I have a trigger rule executing when a new node is saved.

I would like to take the node's title, modify it with PHP and save it into a CCK url field.

I know how to set up the correct action, but I cannot seem to be able to get the node's title into the PHP section.

<?php
return array(
 
0 => array('url' => $node->title),
);
?>

It's working fine with:

<?php
return array(
 
0 => array('url' => 'test url'),
);
?>

Which means I'm having difficulty getting the new node's title.

Checkbox in current node to cause unchecking of same box in any other posts?

private
group: Rules
kirkhings - Fri, 2009-06-26 22:16

I have a CCK type with a particular checkbox which is used to drive what gets published on a front page panel/view featured box. There can only be one thing displayed in that featured box, so it is important when a user publishes something and wants it to be the featured item, any other item that is already set to featured gets 'de-featured', but not deleted or unpublished because that node will still get displayed in other areas.

I've created the first half of a rule ('upon publishing' condition) checking if this is that particular node type and that checkbox is checked...

Use Case: Notify Users of Upcoming Event?

Summitt Dweller's picture
private
groups: Iowa · Rules
Summitt Dweller - Thu, 2009-06-25 16:02

Got a question about Rules module capability before I jump in.

I have a CCK data type which tracks performance dates and volunteer staff assignments at a local non-profit theatre. Note that I'm NOT using the Events module here nor the Events Manager Reminder module which apparently have not been ported to Drupal 6. I am using Date and Calendar.


Restricting forum access with rules, roles and forum access

private
group: Rules
Drew Patrick - Wed, 2009-06-24 08:42

It's a little bit premature asking for help already since I haven't really tried to code this fully - but I'm hoping someone might save me hours of frustration (since I don't have any php experience).

I'm trying to setup a forum that provides restricted acces based on the age of the user. Some forums need to be accessible only by users under 18 and some forums may contain adult content that should only be accessible by users over 18.

Trying to automatically unpublish content based on CCK date field, Rules and PHP field values

wb54321's picture
private
group: Rules
wb54321 - Tue, 2009-06-16 01:06

I am building a web site using Drupal 6.12 (plus the most recent stable releases of token, CCK, Rules and views) and am trying to create a rule that automatically unpublishes content based on the cck date field (generated by the Date API 'date' sub-module).


To publish or not to publish

I_am_trying_to_understand's picture
private
group: Rules
I_am_trying_to_... - Mon, 2009-06-08 03:34

Hi folks

Hoping you can point me in the right direction. New to Rules. Seen Handbook, looked here in Groups.

Have a CCK form with a 2-choice selection field (Public vs Members Only) where I would like registered users to be able to choose if the node is created as a public one or viewable by members only.

I have got as far as giving the Rule a Label, selecting an Event (content is going to be saved), selecting the Condition as being related to the CCK field choice of Public and selection that the Action is Publish saved content.


Rules Monkey: Update #1

klausi's picture
private
groups: Rules · SoC 2009
klausi - Thu, 2009-06-04 14:11

This is the first update of the Rules Monkey Summer of Code project. I will try to produce updates on a regular basis (one in a week or two), although I'm quite busy with exams and university stuff right now (generally in June). Updates will be published in this group at groups.drupal.org and link to the updates will be added to the wiki page.


Rules - Check for term on node page

private
group: Rules
Lantzvillian - Thu, 2009-05-28 21:27

Hi all,

What an awesome module to start with. This has saved me much pain since I am writing a module that would integrate nicely with Rules and I will be releasing it to the community when its complete.

However, I am not sure on where to go from here:

I am trying to detect with Editing condition Execute custom PHP code to find a particular pages term and return true if its there or if its not. I did a wack of googling, played around with modified block visibility snippits, but no avail.

Removing Scheduled Rule

private
group: Rules
gtin - Sun, 2009-05-24 06:22

Hi,

I am new to rules but I was able to create a triggered rule that schedules a rule set to run at a given date when a node is flagged. How can I delete the scheduled rule from rules_scheduler table when the node is unflagged?

Thanks

Rules Scheduler options not appearing in Rules Sets

matias.quaglia's picture
private
group: Rules
matias.quaglia - Sat, 2009-05-16 21:04

Hi!

I am pretty new to rules.
What a great module!
Is helping me to solve quite issues I had for a webiste workflow, so many thanks to you!

I have a question... I want to create a Scheduled Rule Set to happen once a day, in certain time, to publish and unpublish certain content types, and also send some notifications.
So, I can set up the necessary rules from Administer / Rule Sets, but once I've donde so, I need to set up a Schedule to do it.

Right now, I'm not able to see how to do that in Rule Sets, I think I am missing something...


Run Rule once on first login

deverman's picture
private
group: Rules
deverman - Thu, 2009-05-07 02:10

Is it possible to trigger a rule only once the first time a user logs into their account. If I create an account for them I want them to be redirected to update their profile information.


Rules and account creation

Eugene Dubois's picture
private
group: Rules
Eugene Dubois - Wed, 2009-04-29 18:29

I am using rules on a new website at the moment, and I must say it is a wonderful module, which opens loads of possibilities...

I need to create a redirect rule after a potential user asks to create an account.

Is there a way to to this?

Thank you very much.

Eugene Dubois


Rules advanced use

Simon Elliott's picture
private
group: Rules
Simon Elliott - Sat, 2009-04-25 15:26

Hey Fago,
I was at your presentation in Cologne earlier this year and found it very interesting, especially as I'd not come across your module before.

Anyway I'm finally developing a site where I'm using it quite heavily but I have a query which you or the members of the rules group may have an answer to.

On first creation of a node content type 'x' I want to create a node content type 'y' at a specific tokenised url.

So far rule is triggered by creation of node content type 'x', then condition 'does url [og-name]/yyy exist' is checked and negated.


HTML email?

plousia's picture
private
group: Rules
plousia - Wed, 2009-04-22 21:44

Rules, quite simply, rules. It's my new favourite module--thanks so much guys!

What I am wondering is, is there any workaround to send HTML emails with Rules. The client has requested this functionality, and I thought I'd check here before saying "not possible". I couldn't find anything about this in the support forums, so I hope I'm not rehashing an existing issue.

I'm fairly familiar with Drupal, but not PHP (yet), though I can modify existing code somewhat.

Thanks in advance.


Rules 1.0-rc1 is out!

fago@drupal.org's picture
private
groups: Austria · Rules
fago@drupal.org - Mon, 2009-04-20 12:59

I've just released the first release candidate for rules 1.0. There were quite some improvements since the last beta release, so check the release notes. After updating, don't forget to run update.php and help testing the RC1 thoroughly! When no major problems occur I plan to release sometime next week.

The list of issues to be fixed for 1.0 can be found here: http://drupal.org/project/issues/search/rules?issue_tags=rules 1.0


Rules Admin Icons

private

For Rules 1.0, we'd like to improve the icons. Here are the current icons

I pulled these from various open source icon sets.

Action:
- Concepts: (magic wand.... )
magic wand

Add:
- Concepts: (plus sign.... )

Condition
- Concepts: (street sign.... )

let unregistered users to post content FIRST, login, only then node is published...

jacopo3001's picture
private
group: Rules
jacopo3001 - Sat, 2009-04-18 05:22

i have a flash interface to let users create nice design to post as a "Photo" content type node.
this part is done already and it works well.

what i would like to do know is to let people play with this flash even before they register.
only when they try to post their work they are finally asked to register/login.

there are 2 ways to do this:
ask user to register/login from within flash, even before the content is posted.
i dont like this because it means i need to rebuild login/register/lostPassword/etc within flash..

another way i would prefer is:


Rules with Node Expire

public
group: Rules
joemaine - Wed, 2009-04-15 23:16

Rules is one of the best modules - thanks for all of the work!

Having problems with the following scenario:

Create content_type with a default (not editable by users) node expire date of now +60 days
...easy to do with node-expire

When content_type is updated; reset node expire date to now +60 days
...need help

When content_type is published or republished; reset node expire date to now +60 days
...need help

When content-type reaches expire date; unpublish content_type
...easy to do with node-expire

Activity 2.x vs general purpose logging module?

fago@drupal.org's picture
public
groups: Activity · Rules
fago@drupal.org - Mon, 2009-04-06 16:10

I'm currently planning the rule based custom logging module, which I'm going to write after rules 1.0 is out. I post this to the activity group too, because I think there is quite a overlap to 2.x version, which is currently under development.


Package Management

mitchell's picture
public
mitchell - Fri, 2009-04-03 19:11

Note: My proposal has evolved to include a detailed schedule, glossary, and long brief about the reasons why my methodology is at least different, if not better than the existing ones. I have moved the content from this single page to the Package Management project page. The project home page links to the SoC Proposal with the schedule.

Old Titles for this project ordered by earliest (from these you can see 3 major aspects of the project):
Automated Drupal Software Appliance Builder


Rules >> Triggered Rules >> Add Role on Join Organic Group: Help.

public
group: Rules
mach5_kel@drupal.org - Thu, 2009-04-02 01:22

As the title suggests, I am trying to use the rules module to add a Role on joining a specific organic group.

There doesnt seem to be any module for drupal 6.xx (unlike drupal 5.xx). Rules seems like it should be a good fit for this.

This is my first time using this module. I ran through some examples, etc. to get familiar with it.

I Choose >> Triggered Rules

-Add new rule.
Event = User Joins Group

-Add Action
Add Role (then choose the role I want added).

No problem.

Using Rules with a Container Node? Design advice sought.

public
group: Rules
ariesto@drupal.org - Fri, 2009-03-27 17:44

Quesions:

  • Should I design a custom form or a "Node Container"?

  • Is there a way so that Rules can prevent the creation of the "Node Container" after submit? (I don't want the useless nodes)

My goal is to have a "Node Container" in which there is a list of set node types that a user can then select a node type and they are re-directed to the node/add form. The tricky part is that I want to carry-over the title and body field from the "Node Container" to whatever node type they select from the list. See the image attached for a clear example.

Idea: Allow user to choose between direct input and variable assignment

fago@drupal.org's picture
public
group: Rules
fago@drupal.org - Fri, 2009-03-27 14:10

When doing the rules integration this question often arises when one adds a new data type:

Should the data type, when used as argument, make use of an direct input form or should it be assigned by a state variable?

So often there are pros and cons for both approach, e.g. for flag and taxonomy terms. Direct input is easier to use, but the variable assignment is together with an loading action a bit more powerful. So to solve this, the idea is to allow the user to choose between direct input and the variable assignment. Note, that this won't be ready for 1.0 for sure.


Using rules to populate parent item

leo p@drupal.org's picture
public
group: Rules
leo p@drupal.org - Fri, 2009-03-27 13:33

I'm new to Drupal, but have PHP experience. I posted this in the forums with no response:

My problem is this: I am developing a boat website. I have a user tree-menu (built with Taxonomy_menu) with with sub-menus for boat lengths which will contain leaf elements for boats as they are added, viz:

--boats
-----5 metres - 9 metres
--------boat one 5.5m
--------boat two 6m
-----10 metres - 15 metres
--------boat three 10m
--------boat four 12m
--------boat five 13m


Rules and the SummerOfCode?

fago@drupal.org's picture
public
group: Rules
fago@drupal.org - Thu, 2009-03-26 12:21

Hi!

I noted the post is missing in this group, so I just want to point to this soc-idea:

Rules Module extension und perfection (a.k.a. Rules monkey)

Feedback wanted .. :)


Suggestions on an approach using Rules and Workflow Module

bsnodgrass@drupal.org's picture
public
group: Rules
bsnodgrass@drup... - Wed, 2009-03-25 21:26

I just today started looking at the Rules Module. The description looks like it fits the bill but not being a programmer type I want to make sure I am on the right track.

I have workflow, workflow access, and workflow fields set to do the workflow transitions I would like on a per content type basis.

The Rules Module description states, "The rules modules allows site administrators to define conditionally executed actions based on occurring events (ECA-rules). It's a replacement with more features for the trigger module in core and the successor of the workflow-ng module." On first glance I wasn't sure, but...


Tokenized eMails

public
group: Rules
shermann - Wed, 2009-03-25 15:45

Hi,

first of all, thanks for this nifty little module for Drupal.

One question which wasn't answered by reading the documentation:

Rules can use the "Token" module to tokenize some data in some areas.

What I'm missing (actually tried out, but didn't work) is the usage of "Token" for eMail sending.

I'm using also the workflow module and there I can use the "Send tokenized mail ..." action, but I couldn't find anything for the "Rules" module.

Do I miss something or it's just not implemented right now?

Regards,

\sh

Rules Module extension und perfection (a.k.a. Rules monkey)

klausi's picture
public
groups: Rules · SoC 2009
klausi - Tue, 2009-03-24 13:01

Overview

The Rules module is designed to support actions that are executed depending on events and conditions (ECA rules) in Drupal. This proposal is about extending and enhancing Rules module with new features and ideas.

Motivation


Looking for advice on a complex system of executed rules on nodelist from views.

spydmobile's picture
public
group: Rules
spydmobile - Mon, 2009-03-23 20:20

In my system I have a series of nodes that are created every hour, each one with a set of environmental paramaters. the date is stored as a cck datetime with the time ignored and the time is stored as an integer in a cck feild and is from 0-23. Lastly is a field called station which contains a code for a particular station. Now at run time during creation of the nodes, which is handled by feedapi, a series of physics equations which has been converted into php functions and are activated by a set of trigger rules and rule sets.


user_pass_reset_url token

public
groups: Rules · Tokens
shushu - Sun, 2009-03-22 10:25

I am trying to use the CCK+Rules+Token module to accomplish creation of a user when a content with its email address is being created.
This user should get an email notification with his password and/or a user_pass_reset_url link.

The token_user.inc does not provide password, nor the creation of the user using the rules action.
In addition, the !password of the user_mail_tokens does not apply here.

Any suggestion what should be the right way to solve this ?

Regards,
Shushu

Fixing the docs!

fago@drupal.org's picture
public
group: Rules
fago@drupal.org - Tue, 2009-03-17 19:43

Unfortunately the handbook got scrambled when d.o. upgraded to d6. See http://drupal.org/node/376790.

As mentioned in the issue the work is ongoing and hopefully the docs are fixed soon. mitchell and me thought about doing our on documentation site in the meantime or forever, but I think it's better to stay on d.o. - so people can contribute faster, without the need for registering or even logging into another site.. (Yes, every d.o. user can contribute to docs).


Core support for revisions in different states

public
groups: Rules · Workflow
jstoller@drupal.org - Tue, 2009-03-17 01:04

I'm pushing for Core to support having different revisions of a node in different defined states. This would finally allow nodes to be moderated effectively and would provide a greatly improved foundation for modules like Workflow and Rules to tap into. Please take a look at the feature request and join in the discussion:

http://drupal.org/node/218755

Issue queue clean up

mitchell's picture
public
group: Rules
mitchell - Thu, 2009-03-12 22:47

I spent some time today cleaning up the issue queue, but there's a lot more work to do. If you have any feedback on issue queue maintenance in general, this would be a good place.


Prevent Node Creation with Rules

public
group: Rules
Charlie Sibbach... - Sat, 2009-03-07 22:47

The original teaser for this is kind of misleading. The general question: is it possible to prevent the creation of a node with Rules? Based on a condition, can you cancel the creation of that content? I guess an option would be a special purpose role, that has permission to create the content, which is added or removed by the rule.

Executing actions based on RSS content

public
group: Rules
countdwellingto... - Tue, 2009-03-03 19:14

I'm using the built in drupal aggregator - is it possible to have actions fire based on content within a feed that comes in? Let's say I want to send an email every time Obama's name appears in an RSS feed item. Could I use regular expressions within the PHP evaluator?

Set Breadcrumb when using Panels -> node/% - Part 2

public
group: Rules
andersonmh - Sun, 2009-03-01 22:45

Noob here. I am attempting to add Breadcrumbs to panel pages in a more simplistic environement than what was discussed in http://drupal.org/node/363818 using Triggered Rules. I have a CCK Content Type named roster that gets displayed using the Panel module. I followed your discussion in the reference link and attempted to Set Breadcrumbs on the Content Type = Roster. I selected for the Event --> System --> "User is going to view a page". When I got to the page to "Select the condition to add:" I was unable to choose Content has type = roster.

Best Practices

ultimike's picture
public
group: Rules
ultimike - Fri, 2009-02-27 21:02

Hello, I'm in the process of building a site that sells tickets to events using ubercart. I'd like to be able to have a rule that automatically unpublishes the event node when the event date passes.

For the most part, I've been able to do this but there's still a question in my mind as to whether or not I've done it the best way. Here's a quick synopsis of what I did:

  1. Created an "event" content type (actually an ubercart product class).
  2. Added a date field to the "event" content type (field_dates).
  3. Created a rule that is run on cron.
  4. I did not include any conditions.

Flag module integration arriving...

fago@drupal.org's picture
public
group: Rules
fago@drupal.org - Thu, 2009-02-26 08:27

I've just had a look at the flag module rules integration. While developing it, I found a bunch of bugs in rules I've sorted out now - so make sure to install the latest beta5 when you try it.

Issue: http://drupal.org/node/298109


Default conditions?

public
group: Rules
countdwellingto... - Tue, 2009-02-24 00:12

I'm exploring the rules module and there seem to be no default conditions. Hopefully I haven't done something incorrect with the install process, but I've installed a module that integrates with rules (Userpoints). This provides default actions, but no conditions or events.

Are conditions and events something I should expect to be writing myself?

When a custom content type is created, can I send an email to one user related to the created content?

public
group: Rules
victorb - Fri, 2009-02-20 19:10

A have a content type called "client". At the time the client is created, the client is assigned to a user role called counselor. There are several counselors, but only one counselor for each client. When the client is created, can I send an email to the specific counselor notifying that counselor of their new client?

Thanks.

Victor

Send a mail to all users of a role

public
group: Rules
hugoncalves@dru... - Thu, 2009-02-19 14:53

I´m using this action and I think there is a bug.
I´m sending a email to all users of a role, this role has four users. The email is sent, but sent four times 1st mail to user1, 2nd mail to user1 and user2, 3rd to user1, user2 and user3 and so on.

Login Block not firing Login Actions

DruRoot's picture
public
group: Rules
DruRoot - Tue, 2009-02-17 19:24

I'm trying to use rules to execute some code when a user logs in, which works perfectly when users login via the user login page. The problem comes up when users try to login via the user login block, which doesn't fire the user login actions. I've been looking around in the code to try to find where the problem might be so I can write a patch, but I can't seem to find it. Any ideas? Below you'll find my rule export, this is a very simple rule created just to test out this issue.Any ideas?


array (
'rules' =>
array (
'rules_3' =>
array (
'#type' => 'rule',


Triggered rules aren't working

public
group: Rules
webcomm@drupal.org - Fri, 2009-02-13 02:09

Hi,
I set up a couple triggered rules. The actions are not being performed and I don't see any evidence at /admin/reports/dblog that anything is working. Will there be log entries if actions are triggered?

How to use rules with a Node Reference?

public
group: Rules
ariesto@drupal.org - Mon, 2009-02-09 23:57

I'm trying to use a rule so that after Content B is newly created, that the rule triggers and the person is re-directed back to the url of the node that they just created has a reference to. Essentially, I want the rule to follow the node reference that I have already loaded into the node with the prepopulate module, back to the node it references.

How to create event: "User adjusts its location in drop down list" using a drop down list in a created block ?

public
group: Rules
MattDrupalee - Sun, 2009-02-01 20:00

Hello!

I would like to do the following:
1/ create a block with a drop down selection list with a list of taxonomy terms (corresponding to locations)
2/ when the user updates the value in this dropdown selection, it would generate an event, and pass the selected term
3/ then a rule would be created using this event: when it happens, it would trigger an action to redirect the user to a page .../selectedlocation

I think i can do 3/ with rule.. would you know how i can do 1/ and 2/ or of any related documentation? Or do you think of a better way to do it than with rules?

Core "advanced actions"

jredding's picture
public
group: Rules
jredding - Sat, 2009-01-31 03:22

I wasn't able to find the answer to my question in the docs or the issue queue. I apologize if its there and I missed it.

Rules supports core-style actions as per(http://drupal.org/node/299055) but it doesn't seem to support advanced actions. I'm curious as to why. Was this a developer decision? Code that hasn't been developed yet?

What I'm getting at is that a developer can choose to write an action for the actions module or an action for the Rules module but it doesn't seem that they can write an action that would work for both.

Is this correct?


Rules as a complete replacement for comment notifications?

Gurpartap Singh's picture
public
Gurpartap Singh - Fri, 2009-01-23 01:44

Rules is superb! -pause- Is there an existing solution(rule-action or token) to send e-mail to:

a) Anonymous commenter (mailing to created comment author returns "Unable to send e-mail..." warning for anon. commenting).
b) Thread participants or the "rest of"(other than comment author and/or content author) participants. Thread may be whole or parent + siblings + children comment.
c) Author of parent comment (if it is a reply to an existing comment).


Show an added content type.

public
group: Rules
hugoncalves@dru... - Mon, 2009-01-12 19:14

I´m using rules to create a new node, populate some fields and then I wanna show to my client this new node, redirecting client to this node.
There anyway to show this recently create node using rules or getting his nid?
Thanks
Hugo Gonçalves

Syndicate content