Skip to main content

Questions tagged [rules]

Use it for questions about the engine which allows site administrators to automate actions: the Rules module.

Filter by
Sorted by
Tagged with
23 votes
5 answers
9k views

How can I quickly re-save all the nodes on my site (to trigger a rule that activates on content update)?

I made some mistakes configuring a certain content type on my site. To fix these mistakes, I made a rule that performs some actions "when existing content is updated." However, I don't want to go ...
Patrick Kenny's user avatar
22 votes
1 answer
14k views

Programmatically execute an action set (Rules module)

I want to use Rules UI to define some action sets, but want to execute those actions programmatically from a custom module. How to I execute the action by code and pass the needed arguments (just a ...
valderama's user avatar
  • 418
19 votes
3 answers
16k views

How to change a field value with a Rules Action?

I'm trying to set up a Rules Action that can change the value of a field. I created an Action Set with a data type of Node. When I go to create a Rules Action, I have access to every default Drupal ...
Joren's user avatar
  • 2,440
15 votes
2 answers
5k views

Send email notification when a new comment is posted

I'm using Drupal 8.1 with Rules 8.x-3.0-alpha1. I want to create a rule to send an email to the author of a node when a new comment is posted to this node. Problem is I didn't get the email address ...
lolhonk's user avatar
  • 411
13 votes
3 answers
5k views

How to create Facebook style user notifications?

Using Heartbeat I have been able to effectively make streams of user activities through Rules triggers. However I would like to be able to have users notified of new activities, and keep a count of ...
David Gurran 82's user avatar
12 votes
5 answers
19k views

How to redirect anonymous users to login page using Rules module?

I'm using rules module with drupal 7 in order to redirect anonymous users to the login page, so I created a rule with react on event "Drupal is initializing", condition "User has role" with anonymous ...
Aboodred1's user avatar
  • 2,806
9 votes
3 answers
7k views

Email a Whole Node (Including template contents)

I have created my own custom node.tpl.php file. I now want to email the entire node, each time the user creates a new node of that content type (I have made sure that all the HTML in my node.tpl.php ...
big_smile's user avatar
  • 2,828
9 votes
2 answers
2k views

How to set Rules event for "Content is viewed" from excluding Teaser view?

I set up a Rule that will execute during the "Content is viewed" Event and the action was to show a system message. It worked and was triggered when I viewed the node. However, when I went to the ...
radj's user avatar
  • 1,011
9 votes
3 answers
3k views

How to to check if user has changed the password?

I wanted to send basic notification email to the user, after it has changed the password, to inform him of password change. I am using Rules modules for that. But I am not finding any option there, ...
Kalpesh Patel's user avatar
9 votes
2 answers
2k views

How to grant User Points equal to the price of a Commerce Product?

I would like to grant User Point to product owner in amount of product price after a product is sold. For this I defined a rule as below: Events: Completing the checkout process Actions: Loop (...
user1468966's user avatar
8 votes
4 answers
2k views

How can anonymous users be allowed to post while still maintaining content integrity?

A little background: As you see on http://charlotte.ebayclassifieds.com, if you click 'post an ad' and then choose a category, you can fill out the form and submit content without having to sign up. ...
blue928's user avatar
  • 3,804
8 votes
5 answers
8k views

How do I check if a single on/off checkbox is checked?

There does not appear to be any way to check the value of a single on/off (boolean) checkbox in the data selector for the Rules module. If "field-MyField" = checked or "field-MyField" = 1, then do '...
user785179's user avatar
  • 1,009
8 votes
2 answers
2k views

What is the correct way to update existing module's rules programmatically?

I want to provide an update for my custom module, which also has some rules provided via hook_default_rules_configuration. Now, how can I update those existing rules? Can I re-import them? Override ...
Alex's user avatar
  • 2,513
8 votes
5 answers
911 views

How to publish nodes 3 times a day?

I have a list of unpublished nodes, created with the Views module. I would like a task to be run 3 times a day, at specified times. Every time the task runs, only one of the nodes on the list should ...
big_smile's user avatar
  • 2,828
8 votes
3 answers
4k views

Add role to user after joining organic group with rules

I'm trying to add a user role to a user who has become a member of a group. The workflow is like this: User requests to join group. Request is approved by group administrator. User is a member of ...
rroose's user avatar
  • 360
7 votes
2 answers
10k views

How should I use token_replace()?

Could somebody give me an example of how to use token_replace()? I'm trying to write a custom PHP rule for the Rules module that will rewrite few fields of a new saved content, using the values from ...
Alex's user avatar
  • 157
7 votes
3 answers
7k views

How to pre-populate fields on a node creation form based on fields from Profile2 module?

There is a content type ("Job Listing") that a business account can use to list job openings, and a Profile2 profile for each business that contains the business's address, organization name and ...
Adam S's user avatar
  • 5,031
7 votes
2 answers
219 views

How to change a user to a different role based on the number of their posts?

Are there any techniques out there that can put a user in a specific role into a different role automatically after they make X number of posts (core forum topics or/and replies)? I'd like to ...
Beebee's user avatar
  • 6,876
7 votes
2 answers
5k views

Disable editing of a node after it has been published

Scenario: A user can create a node (content type "story"). All story nodes that are created are unpublished by default. I have a boolean field called "publish my story". Once this has been checked ...
Q10's user avatar
  • 440
7 votes
2 answers
772 views

How to stop a loop in rules?

I'm using Conditional Rules module, there some conditions inside the loop I need to break out of. However, there's no action in rules for stopping/terminating the loop. I tried a custom rules where I ...
Ahmad's user avatar
  • 2,835
7 votes
2 answers
1k views

Send mail notification when node of given type gets created

Use case: a small site where I want to warn all users by mail whenever a new content of a particular type is created. I thought I would try Rules+Actions to handle this. I'm working on a vanilla ...
Martin K's user avatar
  • 565
6 votes
6 answers
2k views

Rule condition to check which language is used by the visitor?

I have a multilingual website (English, Spanish). Is there any way to create a rule condition to compare the language used by the visitor against a fixed value? The condition would something like: ...
chefnelone's user avatar
  • 6,257
6 votes
3 answers
7k views

Programmatically import a feed

I can successfully import remote content using the Feeds module by manually clicking on the Import button. I need to execute the import process from code, either from a module or executing PHP code ...
sisko's user avatar
  • 1,720
6 votes
2 answers
5k views

How to use the Rules module to implement a custom redirect for an outdated URL?

I used to show content from a catalog via the Views module, accessing an external database, so that all of the URLs would be something like /content?name=[name]. For various reasons, I've opted to ...
astrosa's user avatar
  • 75
6 votes
4 answers
5k views

How to create custom commerce order states?

I want to create custom order state's and in a view use a "button" or a "select list" to toggle those states. For example I have view that display's a table of all orders that are marked completed. I ...
Samp's user avatar
  • 311
6 votes
2 answers
2k views

How do I send an email to all users that has flagged a node using rules?

I need to send an email when there is a new comment on a node to all users that have flagged that node? How do I do this? The flag is called "Follow" and the content type is "Blog"
Nigel Waters's user avatar
  • 1,024
6 votes
2 answers
2k views

Commerce partial payment : pay deposit at checkout and full settlement later

In a Travel Booking website, how can I configure checkout so that customers pay only a n% deposit of the order total at checkout (off-site payment ATOS solution) ? If the order is created : less ...
Kojo's user avatar
  • 3,513
6 votes
1 answer
2k views

Convert an exported rule to a programmatic rule

I created a Rule through the GUI and it works fine. I would like to convert this into a programmatic rule that I can include with my custom module. This way I dont have to re import my rule every ...
kevinaskevin's user avatar
6 votes
1 answer
3k views

How to create a node from a Webform using rules?

I want to create a node based on a webform data using the Rules module. This is because of a complication surrounding relationships within the associated CRM system. I am already at the point where ...
Darren Whittenham-Gray's user avatar
6 votes
1 answer
2k views

How to use tokens in php code of the rules module?

I'm using Ajax_comments to add comments on nodes without having to reload the page on save. Now the "node history" doesn't get updated which throws off the "new comment" count. I tried to create a ...
uwe's user avatar
  • 12k
6 votes
2 answers
451 views

Which user does the Rules module execute as?

I've set up a rule which is triggered by "after saving a new user account". This rule simply sends an e-mail. The e-mail contains various tokens, one of them is the field [account:field_country]. I'...
sbrattla's user avatar
  • 1,149
6 votes
4 answers
2k views

How to prevent a node being saved when using the Rules module?

Is it possible to prevent a node from being saved with Rules? This is what I do now: Create a rule Before saving content of type ''. Condition: IF ... TRUE => Redirect & set message Create a ...
nielsv's user avatar
  • 786
6 votes
1 answer
1k views

How to create a view of unread comments on own nodes for the user's profile page?

I'd like to create a view for the user's profile page that displays all unread comments on the nodes he/she created. When I say 'unread', I mean that the page where the comment is situated (namely, ...
Jeroen's user avatar
  • 2,518
6 votes
3 answers
797 views

How to mass update recurring date rules?

I would like users to be able to mass update recurring date rules possibly using VBO and Rule sets. For example: user would like to add "exclude date = 01/01/2012" recurring date rule for all ...
LLub's user avatar
  • 3,662
6 votes
1 answer
2k views

Token replacement pattern for triggered rules on node creation

I am currently using triggered rules to send notifications whenever a certain node type is created (by anonymous, unauthenticated users). In the email notification sent I would like to include some of ...
Aiden's user avatar
  • 75
6 votes
2 answers
288 views

How do I update weight using Rules?

I am creating a sampler pack of all my products. I have a product display with several node reference fields (not product reference) so that whenever a new product is added, that reference field is ...
MrPeanut's user avatar
  • 383
6 votes
1 answer
1k views

How to add multiple products to cart at the same time with attributes

I have different view blocks that display multiple products on the same page, each product has their own attributes such as product bundle and custom line item, these serves as an option set / ...
Danz's user avatar
  • 439
5 votes
6 answers
6k views

How to add a custom icon or symbol to a flag link?

I'm working on a 'sample request' implementation for a commerce site using Flag, Views, sessions and a little custom code. I'd like to add an icon or a symbol to let people know that an item they are ...
nizz0k's user avatar
  • 1,172
5 votes
5 answers
3k views

How can I redirect users upon login sometimes but not break the "Forgot password?" function?

I'm using Rules to redirect users with certain roles upon login using the Page Redirect action. The "Force redirect" option is set to true (changing this to false does not fix the problem, and if it ...
Patrick Kenny's user avatar
5 votes
3 answers
5k views

How to find the right token to use in a rule for sending an email to the node author?

I am having the toughest time figuring out how to send an email to the node author. I created my rule and everything works if I hard code the email but I can't seem to get the right token to use and ...
Brian's user avatar
  • 454
5 votes
3 answers
97 views

How to know user submitted first content of a specific type?

I used Rules module to know when a user has logged in and notify the user about his/her login event. Now I just want to check when the user has submitted a content of one specific type for the first ...
Mohammad's user avatar
5 votes
1 answer
524 views

How do I disable a module when Drush or the GUI doesnt work?

My site just gives a WSOD and throws this error: Error: Unsupported operand types in sites/all/modules/rules/includes/rules.state.inc, line 620 Since I can't even get to my site now without a WSOD,...
Patoshi パトシ's user avatar
5 votes
1 answer
859 views

How to show messages starting with "Debug : " to an administrator only?

I'm developing a lot of complex rules in D7 and for debugging reasons it is very handy to have different messages (the standard Drupal message) within the website. For this I use "showing a message on ...
Justme's user avatar
  • 1,248
5 votes
2 answers
510 views

Loop through node reference

I want to send emails using email stored on node fields that are referenced twice by other two contents types. I have this content types relationship: Content1 field1 (unlimited) - ...
Jose San Pedro's user avatar
5 votes
3 answers
2k views

Is it safe to use php within a Rules condition?

Using Rules I need a condition which checks if the logged in user has authored a given content type. It seems that I need some custom php for this and I found the code below from a post on drupal.org,...
MrPaulDriver's user avatar
  • 1,027
5 votes
2 answers
96 views

What's the difference between the 2 different Rules pages in admin?

What's the difference between the Rules shown under Structure > Content Types > My type > Rules and Config > Workflow > Rules? The first one is from Entity Rules (= "Instead of adding ...
user51484's user avatar
5 votes
1 answer
440 views

How do I create a Rule "When role is removed, send email to the user"?

I am trying to create a rule that sends an email to the user when a role has been removed from their account. I can't seem to find a rule reaction under User "When role is removed". How do I create a ...
Nigel Waters's user avatar
  • 1,024
5 votes
2 answers
2k views

How can I check whether a username is in use?

On creating a "course" content, i am creating a dummy user as its "instructor". Here is the related question. I wasn't able to add a condition to the rule that creates the user, that checks whether a ...
turzifer's user avatar
  • 595
5 votes
1 answer
3k views

Pass an argument to a Rules Action using VBO

If I create a Rules Action to set the value of a CCK field, and point to that action from VBO, is there a way to add user inputs to the VBO form on the views page to pass parameters to the Rules ...
Joren's user avatar
  • 2,440
5 votes
3 answers
7k views

Commerce/Rules - Multiply the price by a custom field value

In my Drupal Commerce store, I have a field called Commission. The Commission is input as a percentage (i.e. its not a fixed global value). I need the final price to be updated so it incorporates ...
big_smile's user avatar
  • 2,828

1
2 3 4 5
46