Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I have a config that populates a CCK field, event = Content is going to be saved.
If I do this action via rule set the node is saved again. Also the revision looks nasty (snap.png) - the current revision below the new one.
Indeed that's because rules treats the execution of a rule set as a separate thing. It should be improved to work on top of the same state as the triggered rule. However I don't think this is easy to fix so perhaps it has to wait until 2.x..
I think this bug isn't minor, because if you have node revisions and try to use the Rule sets, you are bound to have duplicate revisions. nasty.
The problem as I understand it is that we save the variables on every rules_invoke_rule_set() - and that function doesn't know if it's nested in another rule. I'd like to work on it, and I wonder what you think is the best approach - hold an array of the currently executed rules maybe and check it reached back to the parent before saving?
Comments
Comment #1
fagoIndeed that's because rules treats the execution of a rule set as a separate thing. It should be improved to work on top of the same state as the triggered rule. However I don't think this is easy to fix so perhaps it has to wait until 2.x..
Comment #2
mitchell commentedComment #3
amitaibuI think this bug isn't minor, because if you have node revisions and try to use the Rule sets, you are bound to have duplicate revisions. nasty.
The problem as I understand it is that we save the variables on every
rules_invoke_rule_set()- and that function doesn't know if it's nested in another rule. I'd like to work on it, and I wonder what you think is the best approach - hold an array of the currently executed rules maybe and check it reached back to the parent before saving?Comment #4
fagoI set it back to active, as this is an important think, which we shouldn't forget about!
Comment #5
fagoMarking #430502: Recursive saves can be triggered while in "Content is going to be saved" as duplicate.
Comment #6
fagoI'll have a look if I can fix it before doing the 1.0 release.
Comment #7
fagook, I've implemented it. Please test.
Comment #8
fagoComment #9
RoboPhred commentedConfirmed fixed in -dev April 21, thanks!