I have a VBO set, to modify a CCK number field of multiple nodes. Also I have a Rule set to update another CCK field after updating a node (on event "after updating existing node").
When I select multiple (or single) rows from the View and hit "Modify node fields" button, I get the form and to input the new value for field and it updates nodes correctly - as it's supposed. But the Rule is picking up values from unchanged node.
This isn't happening in "save node" action - Rules picks up the correct CCK fields (just-changed values) and continue the Rule. But in "Modify node fields", it's picking up unchanged node's values (checked it by dpm() ).
Can you please give me any hint about what I'm missing ?
Or is it normal that "Modify node fields" action don't use standard node_save() ? (Rule triggers in both actions).
Thanks for reading this and especially making such awesome module!
Comments
Comment #1
acrazyanimal commentedHey there not sure if this will help, just a quick guess. Are you sure you are looking at the right object in the rule? I know that the "after updating existing node" has both an altered and un-altered node object.
Comment #2
infojunkie@acrazyanimal, thanks for chiming in.
@Ayesh, VBO does call
node_saveautomatically after executing the action on each node. But the usage of the save node action you're describing doesn't say much, because there was no modification to be saved (since the action only saves the existing, unmodified node). Maybe you should try with core actions such as publish/unpublish and usedpm()in the rule to see the difference.Comment #3
ayesh commentedThanks. A lot acrazyanimal and infojunkey.
The rule itself has some execution weight differences so I was thinking there was a problem in the rule.
However I managed to get the functionaity by creating a rules set and using it as the action.(so I can set the value of the field and save the node and proceed to other rule executions)
Thank you all of you for your information rich replies.
Marking this as closed. Please correct any wrong thing here.
Thanks again.