The Rules module is a module that allows site administrators to define actions that are conditionally executed, either programmatically or in response to predetermined events.

learn more… | top users | synonyms

3
votes
2answers
29 views

Control content type availability based on day and time

I have a website that delivers products that are ordered during the day. I would like the order form to only be available during business hours. Outside of those hours, the form shouldn't be ...
0
votes
0answers
14 views

How to make sure the correct callback is processed?

I'm developing a module which add an action in Rules: In the file .rules.inc I have: function universal_document_creator_rules_action_info() { return array( 'udc_createdoc' => array( '...
1
vote
1answer
34 views

How to validate dependent fields for a content type?

In one of my content types I have 1 field 'venue' with a drop down option. If I select 'venue' as 'other' from the drop down, some other fields (say 'venue address' and 'venue name') should become ...
0
votes
1answer
8 views

Delivery Date Changes Price field value with New Custom Field

I got project with following requirements: The customer should be able to select delivery date(date popup) in the checkout form. The administrator can set special delivery date, in configuration ...
1
vote
2answers
29 views

Send mail to the admin when user fails to login

I need to implement the functionality to notify the admin user via email whenever someone fails to login entering wrong password. Basically simple email format containing the username for failed ...
2
votes
1answer
57 views

How to retrieve data in a field collection within a Rules Condition?

I want to add a rule (using the Rules module) for printing a message after changing a field in a field collection. The field collection consists of the following three fields: Reference to Version (...
2
votes
1answer
39 views

How to change the value of entity reference’s field by using the Rule module?

I have two content types: Inventory Sales In Sales content type I referenced “Inventory Content type” through entity reference module. In Inventory content type, I had a field: “stock_available” ...
0
votes
0answers
25 views

Rules condition that checks average vote tag results

I use Fivestar and Rate modules separately on a site therefore I have separate voting api tags. But I can't create the condition to check if the average vote of a specific tag on a user's authored ...
-3
votes
1answer
25 views

How to show one node from particular content type into all other pages?

I have content type and have few fields and I want to display each node from that content type into basic page. In this i want to choose which node i want to display on which page. Like i want to ...
3
votes
1answer
22 views

How to make 2 Rules work that use the very same Rules Event?

On a D7 site I have two rules (using the Rules module) reacting on the same event which is 'After saving a new entityform submission'. When the actual event occurs only 1 gets fired, even though I've ...
0
votes
1answer
35 views

Field updated date in view

I am using Drupal 7 and I have a view displaying the Updated date. Unfortunately, the Updated date changes every time I save the node, even if no changes are made. How can I configure the Updated ...
3
votes
1answer
52 views

How to properly add inline Javascript code to a webform with javascript injector module

I have recently started leaning Drupal 7. I have built my first Webform and I'd like to add a field that calculates automatically number of days between two dates as shown in below I tried to follow ...
4
votes
2answers
38 views

How to use the Rules module for assigning a role during user registration based on a select field option?

I need to assign a role to user based on select field at the time of registration. I have added a field in user registration form (ex: school checkbox) . When user click on school I need to assign a ...
2
votes
3answers
70 views

How to have a field that counts the nodes submitted by the current user?

My site with existing content needs a field that shows the number of nodes of a certain content type that have been created by the current user. I can't use Views because the field needs to be able ...
0
votes
0answers
12 views

Webform rules - delete duplicate webform

never use rules before and a bit lost there... here is what I'm trying to do. It may sounds a bit strange, but... I have two Webforms. let call it form1 and form2. form1 is located on front page ...
2
votes
1answer
60 views

How do I access a custom field from an action?

I want to access a custom field names field_heat in a Rules action in D8 and it does not accept it. This is my condition: And this is my action which cannot be accepted: If I use a build field ...
0
votes
0answers
34 views

How to get multiple content types fields value in Rules

I have four content types (Test1, Test2, Test3, Test4). And one more content type(TestAll). TestAll has some entity referenced fields from all four content types. Now if i create these four content ...
3
votes
1answer
17 views

How to populate field X with value of field Y in Organic Groups?

I want to use rules in order to populate Organic Groups field X value with the value of field Y. Keeping in mind these fields are Organic Group fields. Field X is a 'long text & summary' field, ...
2
votes
1answer
31 views

How to use Rules to auto populate field B with the value of field A after saving a new node or updating an existing one?

This must be easy, but I just can't figure it out ... My scenario is like so: I have a content type with field A (title_field - text field) (that contains the title) and field B (field_tagged_as ...
0
votes
1answer
14 views

rules does not have any action for publish seleccted content

In admin/content page we have some update options. I want to execute a php code only when I use 'publish selected content' or 'unpublish selected content' on that page. This rules should be fired ...
0
votes
0answers
14 views

publish selected content does not work with $node

I have written a rules to make my own URL alias and code field programmatically when node is saved or updated. This is my code: if (empty($node->path['alias'])){ $record=db_query("SELECT MAX(...
1
vote
1answer
46 views

How to use tokens in data selectors in Rules and how to get autocomplete to work?

In Drupal 7, the Rules module was quite simple to use. You create a rule, define it's action and done. In Drupal 8 version of Rules however, i.e the alfa1 version (which is what I'm using), I see some ...
0
votes
1answer
19 views

Route logged in user to profile on all request to <front> node

I'm attempting to make a simple login page on the front page that once you log in it will route you to your profile. This part I got working with Rules, but if the user clicks the home link on the ...
2
votes
1answer
34 views

How to mark a node as read per user?

I'm wondering what the best solution is to mark a node as read per user. The below scenario is what I am trying to achieve: Admin creates a node which requires to be read and confirmed and flags ...
3
votes
1answer
31 views

Combining AND and OR in Rules

I'm trying to set up a rule (using the Rules module) with AND and OR conditions. I have a content type with a field A (date) and field B (time slot). The rule needs to check if field A is either e.g. ...
0
votes
0answers
22 views

Getting Recoverable fatal error: Object of class stdClass could not be converted to string in DatabaseStatementBase->execute()

I'm getting an error message when trying to use a function from a custom module in a rules condition. (Drupal 7.41, Rules 7.x-2.9). The error is: Recoverable fatal error: Object of class stdClass ...
1
vote
1answer
17 views

What to do when saving nodes one-by-one and bulk resaving give different results

I'm using the Location Taxonomize module with the Address Field module to create a vocabulary of node locations. I want to re-create the locations from scratch, and I have a term reference field ...
1
vote
1answer
16 views

How do I fetch the product display nodes referencing the given product using “Fetch entity by property”?

Let me start off by saying that I am ultimately trying to get the product display from a line item. I would use commerce_rules_extra, which has a feature that is supposed to do this, but I could not ...
3
votes
1answer
36 views

How to replace spaces with dashes when redirecting users through Rules?

I have a rule that redirects users on login to a matching taxonomy term, ie. there is a taxonomy term that is identical to the user name and when a user logs in they are redirected to the url of that ...
1
vote
1answer
28 views

How to update field after ubercart checkout completion?

I have created a field (checkbox) in user profile edit form that is only visible to admin. When the user completed their checkout process (after payment) that field which I created previously must be ...
0
votes
1answer
32 views

how to use token in “Execute custom PHP code” in a rule

I used "Execute custom PHP code" in my pricing rule. However I got Notice when I checkout: Notice: Use of undefined constant testsku - assumed 'testsku' in eval() (line 7 of /var/www/jmu/sites/...
1
vote
1answer
18 views

When creating a new user with a order, how to email the new user login details

I am using Commerce Admin Order Advanced. It allows the following extras when creating an order in Drupal Commerce Search users by email or profile name before creating the order Select existing ...
2
votes
1answer
55 views

How to include only an updated custom field in an email created using Rules?

I used the Rules module to create a rule with an event "After update existing content". This rule sends an email to the editing user when that user makes an edit to one of the multiple custom fields ...
0
votes
0answers
10 views

D7: Simple LDAP & Rules modules - do they work together?

I have Rules and Simple LDAP modules instead in an D7 site and I want to know if they work together based on this rule: If a new account is saved, then assign it to a role. Right now, when a user is ...
3
votes
1answer
43 views

How to change the default date format in Rules?

I've created a rule to send an html email which contains a date, printed using tokens as [commerce-order:field_delivery_date]. In email, the date looks like 2016-07-08 00:00:00 to 2016-08-02 00:00:00. ...
1
vote
1answer
34 views

“Missing configuration for parameter commerce_order”

I'm trying to define a default rule in a small module based on Commerce Price Table and Commerce Rules Extra. The rule is to set price based on the quantity of produtcs that contains a partial sku in ...
0
votes
1answer
21 views

How to allow node authors to mark the best comment and to promote this comment on the top of list

In my project comments are prices so its important that commenters see author's choice. I want to allow authors to choose the best comment that would get this comment promoted on the top of a comments ...
3
votes
1answer
103 views

Set (add) group role using Rules when organic group membership is updated?

Using Rules, I am trying to set a users group role anytime a new membership entity is updated, however it appears roles are not brought into scope for me to set data value nor "grant og role" All I ...
1
vote
0answers
12 views

trigger a action based on the presence of families of products using rules?

How would I trigger a action based on commerce_product_calculate_sell_price if families of products (or quantities of families of products) are present using rules? For exemple, if the cart contains ...
1
vote
2answers
55 views

How to use the Rules module to unset all flags (set x days ago) without using Rules Scheduler

This is a follow-up to my question "How to use the Rules module to unset all flags (set x days ago) when cron runs?". Case: users set flags on content using Flag module (flags are per user, not ...
0
votes
1answer
27 views

Rules event is not triggering

I've created a custom action to fire when the "checkout is complete" event occurs. The front end is a mobile application, where as the back end is Drupal. So I create an order using its API and update ...
1
vote
1answer
38 views

Set value on newly created node using Rules

This is what I have now: Content type 123 has a Entity Reference field referencing content type XYZ. If new content is created of type XYZ then Rules creates new content of type 123. So by creating 1 ...
1
vote
1answer
44 views

How to use the Rules module to unset all flags (set x days ago) when cron runs?

Case: users set flags on content using Flag module (flags are per user, not global). Requirement: after a period of time the system should automatically unset these flags using Rules module. The ...
1
vote
1answer
83 views

How do I create a custom rule action? [closed]

I have drupal 8, and I want to create a custom rule action. I have created it in Drupal 7, and it's working fine. I have no idea how to do it in Drupal 8. Can you please explain which code should I ...
1
vote
1answer
27 views

CKEditor Link a content with rule as a hypelink with title and url to a custom field

I would like to add a hyperlink entry in a blog which points to a internal content URL with different content type which needs to be display for authenticated users. 1.) The hyperlink should show the ...
0
votes
1answer
26 views

Hide the display of a field conditionally

I have the following scenario: I have many users created from People->Add user I have a content type (named Project) with the following fields: --Leaders (Type: Entity Reference to Users) --...
1
vote
1answer
38 views

Using computed field value in Rules

I'm using Commerce module and I have a line item with a computed field that's calculating a date. This field finally shows a date. Then during the checkout process I have a form with a Date field (...
1
vote
2answers
36 views

Showing both original base price and calculated price (inc. taxes), when using two price fields and rules

Building a webshop for customer with Drupal 7 + commerce. I've defined two price fields for commerce product entity: 1) base price (excluding tax) that is wholesale price 2) retailer price (excluding ...
0
votes
2answers
23 views

Creating entity in Rules causes PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

My application based on CRM-Core. I am using several rules which launch on the event "After saving a new crm core contact" and each has a crm_core_activity entity created as the rule's action. Is it ...
0
votes
2answers
38 views

Different ways of logging in a user without having them to type anything?

I'm on Drupal 8 and currently looking to replicate similar functionality like: https://www.drupal.org/project/urllogin -- They do not have a D8 version yet. I need to auto login a specific user ...