Using Drupal 7.15. I wrote a rule containing custom PHP code that POSTs the node ID to an external system. That system accesses the Drupal REST server, retrieves the specified node, and copies its content.
Problem: It gets the version that existed before the current save command. The action specifically says that it is run "After updating existing content" so I can't understand why I consistently get the previous version.
0 ms Reacting on event After updating existing content.
15.618 ms Evaluating conditions of rule TEST rule on save content. [edit]
15.652 ms AND evaluated to TRUE.
0 ms Rule TEST rule on save content fires.
0.265 ms Evaluating the action entity_save. [edit]
1.155 ms Saved node of type node.
0 ms Reacting on event After updating existing content.
0.393 ms Not evaluating reaction rule TEST rule on save content to prevent recursion. [edit]
0.412 ms Finished reacting on event After updating existing content.
26.716 ms Evaluating the action php_eval. [edit]
1944.527 ms Rule TEST rule on save content has fired.
1960.253 ms Finished reacting on event After updating existing content.
Similar problem, but for user instead of node: Rules - After updating / saving user not working
Discussion on drupal.org: http://drupal.org/node/430274 I have tried the fixes suggested in replies #13, 14 on that page, with no success.
Update: I added a separate action on to run entity_save, and set its weight at 0. The original rule's weight is 5 so it should run after the force save is complete. Same result, and it takes twice as long now.
0 ms Reacting on event After updating existing content.
16.051 ms Evaluating conditions of rule Force save after update. [edit]
16.083 ms AND evaluated to TRUE.
0 ms Rule Force save after update fires.
0.29 ms Evaluating the action entity_save. [edit]
2.513 ms Saved node of type node.
0 ms Reacting on event After updating existing content.
0.386 ms Not evaluating reaction rule Force save after update to prevent recursion. [edit]
0.431 ms Evaluating conditions of rule TEST rule on save content. [edit]
0.448 ms AND evaluated to TRUE.
0 ms Rule TEST rule on save content fires.
0.161 ms Evaluating the action php_eval. [edit]
1954.427 ms Rule TEST rule on save content has fired.
1954.943 ms Finished reacting on event After updating existing content.
1984.676 ms Rule Force save after update has fired.
2000.878 ms Evaluating conditions of rule TEST rule on save content. [edit]
2000.902 ms AND evaluated to TRUE.
0 ms Rule TEST rule on save content fires.
0.199 ms Evaluating the action php_eval. [edit]
2422.949 ms Rule TEST rule on save content has fired.
4423.939 ms Finished reacting on event After updating existing content.