Hot answers tagged

3

If the data about a product are not available when processing a "line item", you can make them available. To do so, use a technique similar to what is explained in my answer to "How to access commerce_product field of line-items using Rules to flag the Commerce Product?", which includes a Rules Component that looks like so: { "...


2

You need to give the "Administer comments and comment settings" permission to the role and then it will be able to approve the comment.


2

The rule needs to overwrite existing scheduled actions if a new comment is posted on the same node. Yes, you can do this! And you don't have to delete any scheduled tasks. The key here is to use the scheduler action's identifier parameter correctly. There can only be one scheduled component per identifier, so if your identifiers are all the same (for ...


2

To my knowledge, there is nothing in Rules to "overwrite existing scheduled actions" (as in your question). However, by every time attempting to perform an appropriate delete of an already scheduled rule, prior to scheduling a new rule, you achieve a similar result. And such attempt just gets ignored if there was no scheduled rule yet. Read on for more ...


2

The problem was that I had to fetch the entity by property [cloned-node:author:field-firstname] inside the conditional and set the data value [cloned-node:field-student-name:0] to [firstname-fetched:0:field-firstname] I still don't understand the actual logic why [firstname-fetched:] has to be followed by [0:field-firstname] but that works. See screenshots. ...


1

As a workaround, i ended up using the views rules module at drupal.org/project/views_rules which "Provides Views directly as Rules actions and loops to seamlessly use view result data."


1

First, you should be using the current -dev version of Rules - that will make it much easier to do what you want. Second, for the "Node is of type" condition, switch to the data selector for the first entry then select "node" from the data selector. This is the data object "node" that was created. For the content type, enter the machine id of the content ...


1

It looks like you already found "a" solution for your own question, but since you don't really understand your own solution, and because IMO there is an easier to understand solution, consider the below alternative ... Step 1: Create a Rules Component Create a Rules Component (of type "action set") like so: Parameter "node_to_update" and "node_author". ...


1

I would use a technique similar to what is described in my answer to "How can I compare data comparison with values submitted in a webform?". For short: Add an extra Rules Action to Add a variable, with a value assigned to it equal to your Webform data you want to use (and with an appropriate data type). You'd need 1 such variable for each Webform component ...


1

you will need flag module make a global user flag: user_has_content, make a rule: react on event: after saving new content of your special type, add a condition: user author is NOT flagged, inside rules action: flag it, only once your user author will be flagged, then on your view, add relationship to author & one more relationship on the new flag on ...


1

You should be able to get this to work, using the Rules module, using the "Drupal is initializing" event. That will ensure that the rule gets triggered BEFORE the actual content is shown. Using Rules event " Content is viewed " is typically 'too late'. Refer to 'How to specify a Rules event like "Content is 'going to be' viewed"?' for more ...


1

Make a flag on users: 'flag_user_has_logged_out', you will need more than one rule, first rule: react on: user has logged out, and flag the user with this new flag, on another rule: react on logged_in: first validate your roles, then validate if user is 'flagged' if so, redirect to /whatever, and unflag user has logged out. if not, the other redirect will ...


1

I'm assuming this needs to happen behind the scenes rather than as a result of user interaction. I suggest you write a custom rules action which runs on cron every 5 minutes (or whatever time period you are happy with). The rule should load all of the relevant nodes using a db_select query, loop through them, check the end date and update the status ...


1

This is very easy to do in D8 Rules. Here is an export of a Rule which does what you asked - when a new user is created, it creates a new node (of type article, as an example). It then sets the node author to be the new user. It then sets a field of the new node (the body field, in this case) to a value take from the user (the user's email address, in this ...


1

Here's a simple Rule that will react on a webform submission and create a new node of type "Article" with the article title set to the submission time to show how webform submission values may be used to set node values. This Rule assumes you have the default webform type "Contact" enabled. Use the Rules 8.x-3.x-dev version and you can import this Rule and ...


1

There's a working example in the Rules issue queue that was posted in November 2016, so this has been possible at least since then. See https://www.drupal.org/project/rules/issues/2828422 Here's a slightly modified version of that answer. You may import this into your site and look at it in the UI to learn how to configure this functionality. langcode: en ...


Only top voted, non community-wiki answers of a minimum length are eligible