3

I am on Drupal 7, and I am trying to make a rule that closes comments on a node 30 days after they have been created. I am assuming I need to make a component that has an action of "set data value:" to change the "node:comment" to 1. Where I am confused is how to schedule that component to fire 30 days after the node has been created.

Do you have any suggestion?

1 Answer 1

2

You need at least 2 rules to make this happen. One is an actual "rule" and the other is a "rule component".

You are correct about the second one being a component which sets the data value on node:comment.

The other one, the rule, needs to be set to activate on the event "After saving new content."

An action for this rule needs to be "Schedule component evaluation". Setting this action then requires you to configure the evaluation, where you set the particular rule component to be evaluated, and then set "Scheduled Evaluation Date" as well.

To make it happen 30 days in the future, enable Data Selection mode, and select "site:current-date", then for the offset field which now appears below it, select 30 days. This will cause your selected rule component to be evaluated 30 days from the current date/time.

After configuring all this and testing it, you can check to see if it works by going back to the Rules interface and going to the "Schedule" tab. Your scheduled task will be listed there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.