Questions tagged [rules]

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

1
vote
1answer
56 views

How do I create a tax calculation rule that runs by default before the customers address has been set?

With Drupal Commerce and the Australian GST calculation module, I have been trying to calculate taxes as early as possible. Most of the customers to the site are Australian and will have to pay the ...
1
vote
1answer
61 views

How to create a node and populate its fields with info from a completed goal?

I need to create a node and populate its fields with data from a completed Goal (implemented via the Goals module) using Rules. The completed Goal info is fetched using the method from the question ...
1
vote
1answer
489 views

Send email notification to node author with Rules

I am trying to notify the node author of a new comment on their node. Using Drupal 8.3 Created new reaction rule. Send to: comment.entity_id.entity.uid.entity.mail.value email address is not ...
0
votes
1answer
45 views

What is wrong in my Rules Conditions to trigger a scheduled unpublish of a node?

I have a content type 'company' which has a field: field-paid. This field is a integer list who only has 1 option: 'yes' This is my export of my rule: { "rules_testv2" : { "LABEL" : "Depublish when ...
1
vote
1answer
91 views

rules_invoke_component() - Getting the value of the Provided Variable

In my code, I am using rules_invoke_component() to invoke a Rules Component. On that Rules Component, have 2 variables. Parameter Provided I am successfully able to invoke the Rule and send the ...
0
votes
1answer
55 views

Forward user email address

I use Webform with Commerce product skus field. Now I have a rule to send out an email to customer if webform is submitted. That works fine. But I would like to set a rule to send the email when the ...
1
vote
1answer
76 views

How to create a rule that checks an extra profile field created with the core profile module?

I have a Drupal 7 site with the Honeypot module installed. Honeypot removes or prevents many spam registrations, but not all. I have extra fields added to the profile e.g. 'profile_field1'. I'd like ...
3
votes
2answers
350 views

Rules: Load List of Entities by Object or Entity ID (Performance)

I'm looking to load a list of Users by an Entity Reference Property within Rules. There may be times when I need to load hundreds or thousands of Users that have a matching Property to update a ...
1
vote
1answer
40 views

Why is Rules Link checking all Rules Links on every page load?

I am using the Rules Link module in a Drupal 7 site. The site contains a view that lists a number of entities, including the Rules link field. The Rules Link rule set is simple: when clicked, data of ...
3
votes
1answer
35 views

Rules: get content created by user account being cancelled?

Case: using Rules module, when a user account is cancelled, create a new node of type Archive and (a) copy select data from that account to the new node of type Archive, and (b) copy select data from ...
2
votes
1answer
114 views

Flags: flagging unflagging rules, how to check if an user has already flagged a node?

I'm using Drupal 7 and I created 3 flags for article content type; these flags are global flags: bad, nice and cool. Now, I want create a rule in order to check if an user has already flagged an ...
1
vote
1answer
83 views

How to send a push notification with Rules to specified user by grabbing UID from content field?

I want to send a push notification to a single Drupal, which, seems simple given the below screen shot. This works great when the user is always the same (I simply type in the UID). However, in my ...
1
vote
1answer
123 views

How to loop through a dynamic taxonomy vocabulary and if term is chosen, do an action?

My problem is as follows: I have a taxonomy vocabulary with terms, which are changing from time to time. I have two node types --> type 1 and type 2 Type 1 has a taxonomy term reference field Type 2 ...
2
votes
1answer
212 views

How to get the pre-save version of a field collection in rules

I have a node with a field collection called itinerary, and that field collection contains a user entity reference called traveler. The node can have unlimited itineraries and an itinerary can have ...
1
vote
1answer
64 views

Sender name in MimeMail send HTML mail rule

I have a local site I am testing. I have PhPMailer installed which works fine to send plain text email with the Sender name populated properly. However when I installed MimeMail and try to use the ...
3
votes
1answer
415 views

How do I get an argument of a path with Rules URL Argument?

I am trying to get the first argument of a path in rules. That argument would be needed to fetch an Entity. I have no idea how to "tell" Rules URL Argument "get the first argument". Then I tried to ...
0
votes
1answer
224 views

Split commerce cart to multiple orders per product

What's a solution in Drupal Commerce to create an order per product in cart during the checkout? The cart looks like this: Product A, Quantity: 2, $100 Product B, Quantity: 1, $199 Total: $399 The ...
2
votes
2answers
867 views

Rules fatal error during update: Call to undefined method stdClass::events()

What I have tried: Clear Cache. Disabled module and enabled it. Try with registry_rebuild, module_missing_message_fixer, variablecheck modules. Still getting the below error when I try ...
1
vote
2answers
301 views

How to fire a Rule after adding a new file in multi-value field?

Working with Drupal 7.56, Rules 2.10, Conditional rules 1.0-beta2 and File Entity 2.4 I can't fire a rule when I add a new image in a multi-value Image field (related to File Entity for inline fields)...
2
votes
1answer
515 views

Setting data values in a paragraphs field with multiple values via rules?

Over the last few days I've been investigating and experimenting on how to use rules to alter fields within a paragraphs bundle on a node. The paragraph field on the node allows for multiple values(to ...
1
vote
0answers
32 views

Reaction rule raises TypeError

I have a working Drupal 8.3.7 installation and use the rules3.0alpha module. I add a reaction rule that is applied After saving new comment. That's all. Now, when I try to save a comment, I get an ...
1
vote
0answers
77 views

Apply a discount rule when calculating cart total?

I would like to apply a discount on cart items at check-out. The discount will be based on quantity of particular product type. What event can I use to calculate a discount during checkout? Here is ...
0
votes
2answers
20 views

Is it possible to alter the data passed into a Rule?

I have a bunch of Rules and some things require a bit more complex logic than usual. What I want to do is use a hook that runs when a particular rule fires, access the data that's passed in to it and ...
0
votes
1answer
231 views

How to make Drupal Commerce send email notification to the author of products sold?

I use Drupal Commerce and the rules module to send email which works OK. But it doesn't send the email to author node of product. Here is an export of my current rule: { "...
1
vote
1answer
56 views

How to fetch the completed goal as an entity with the Rules module?

Followup question for the question about "How to access fields from a goal when creating a node with Rules?". I'm trying to create a rule that finds and uses the fields of the goal that triggered the ...
0
votes
1answer
60 views

How to pass an argument to be used in the view called by rules

Context: drupal 7, views, Rules, Views_rules Goal: to send an email to all users that have the same taxonomy-term as the newly posted node Possible solutions known to me: (1) A Rule calls the view ...
1
vote
2answers
362 views

Display all nodes with identical field value to current node

BACKGROUND: Site is using content types which are auto-created through Rules, called CT-A and CT-B. CT-B represents a full URL, and CT-A represents that URL domain. CT-A is always created via Rules ...
1
vote
1answer
43 views

How to access fields from a goal when creating a node with Rules?

I'm trying to create a rule with the Rules module that posts a node when users achieve a goal (using the Goals module 7.x-1.3). I want to get fields from the goal like the goal image and other fields, ...
1
vote
1answer
112 views

How to update a computed field in a rule's “set data a value” action

I have a custom field called field_balance in the user account form which is a computed field. It keeps the actual number of coins bought by the current user. That value is supposed to change (...
1
vote
1answer
62 views

Which entity to check in Rules to disallow taking a Quiz after passing it?

I need a way to restrict Quiz access for users who have achieved a passing grade to stop them retaking the quiz to gain more user points. It displays "You have already passed this Quiz.", but I can'...
1
vote
1answer
109 views

How to check Commerce product type of current line item in Rules?

When building a Drupal Commerce rule, I would like to loop over all line items and determine the product type for each line item. I would like to use the product type in a Rules Component to check ...
3
votes
1answer
454 views

How to check the value for specified field across all nodes?

I have minimal Drupal and PHP experience ... Problem: I have an autocreate function for a Content Type ('hannibal'), which has one defined field type ('faceman'). When Content Type 'hannibal' is ...
1
vote
1answer
305 views

How do I fill the authors name in a term reference field using Rules?

Content type stock contains the term reference field field_producer. What is the rule for Rules in order to fill this field with the node author name on creation? In detail The form looks like: -- ...
1
vote
2answers
325 views

How to check if user has passed the quiz already before granting user points?

I'm awarding users points for passing a quiz successfully. However, there's nothing stopping the user taking the quiz again and again to score more points. I have thought of these options, but I don'...
3
votes
2answers
392 views

What does Rules token “node:unchanged” mean?

I am on Drupal 7 and I am using the Rules module to do some stuff. I must say that I am not very used to using this module; there are few questions that need answers, such as the use of the node:...
4
votes
2answers
174 views

How to notify users when a new comment is posted in the same page as they did?

I have a Drupal 7 website and I display comments on a content type. What I want, is for every user to have a boolean field in their profile, to declare if they want to be notified when a new comment ...
1
vote
1answer
16 views

How to increase a scheduled time using a new field and rules component scheduler

I am working on Drupal 7 on a custom content type that is called Event. Each created Event is programmed to be displayed for 1 hour before been deleted. I am using rules component scheduler for that ...
5
votes
1answer
2k views

What's the alternative to using the Conditional Rules module?

The Conditional Rules module allows for including Rules Conditions within Rules Actions (using its If/Else constructs), something you cannot do by only using the Rules module. Here are just a few (out ...
1
vote
1answer
34 views

Fix 404 error when adding conditional action to Rule?

Subsequent to what I saw in the question 'Don't calculate shipping for specific item', I tried to create a rule with a conditional action (screen capture below), but it causes 404 error: The export ...
3
votes
1answer
52 views

How to unpublish a node and any related nodes?

I am currently working on a problem where, when a Physician node has been unpublished, its related Review nodes will be unpublished as well. They do have an entity reference built in to distinguish ...
1
vote
1answer
100 views

Don't calculate shipping for specific item

I have to types of a same product (used a select list field): 1|Physical 2|Digital (key|label) Physical items needs shipping calculated. Digital doesn't. Problem appears when you add physical and ...
1
vote
1answer
19 views

Commerce: Don't calculate extra shipping for 1st item

I have a flat rate of $2.50 for every order. I have extra +$1 for every extra item added to cart. So, if I order 1 item, total shipping is $2.50, but if I order 2 items total shipping is $3.50. My ...
1
vote
0answers
44 views

How to ban a commentator's IP address with Rules?

When spammy comments appear on my website, I delete them and manually add the commentator's IP address to the banned list. However, it should be easier to Flag the comment with a new comment Flag Spam ...
1
vote
1answer
72 views

How to pass the Body field from a View to Rules?

Context: using the Views Rules module to pass a number of items to an action-loop in a Rules component (Action Set). In views (display: rules) I selected among others the Body-field to be used. This ...
1
vote
0answers
30 views

Running rules as a different user

Is there a way to have a rule run as a specific user instead of the person who triggers it? For instance I have a rule where, if an authenticated user posts a certain type of content it creates a ...
1
vote
1answer
43 views

How do I create a link to a node to put in new entity?

So what I'm trying to do seems pretty simple. And I've found lots of posts similar to it but none have really helped me. I have a an application content type, when somebody submits it, I'd like to ...
2
votes
1answer
198 views

Accessing custom taxonomy term fields in a rules loop

I am building a rule that on node save will loop through taxonomy terms added to an entity reference (taxonomy term) field, build up a list of users from an entity reference (user) field in those ...
2
votes
1answer
100 views

How to get a list of entities programmatically?

I wrote custom rules action to get a list of active simplenews subscribers, but I can not process it with "loop" cycle. Action should get list of active simplenews subscribers ("entity_fetched" array)....
2
votes
1answer
380 views

Where is Rules Action 'send mail to all users'?

I installed and configured the Rules module. When I try to add a rule like notifying a new comment to all users, I do not see the Rules Action "send mail to all users". Is that normal? Are there any ...
1
vote
1answer
109 views

Rules Scheduler Component parameter is empty

I created a rule for scheduling a action component after 48h. The rule gets triggered correctly and the task shows up at the "Workflow" tab in rules. The problem is that the scheduled component gets ...