I created 2 simple actions, A1 and A2, which just uses drupal_set_message to print out "A1" and "A2" respectively when they are executed.

Under Rules admin,

  • Event = After saving new content
    actions = A1
  • Event = After updating existing content
    actions = A2

I created a new node.

Expected behaviour: A1 is executed.
Actual behaviour: A1 AND A2 are executed.

Question: Why are both actions executed when a new node is created? How can I configure to allow A1 to be executed on a node creation, and A2 to be on node update?

Thanks in advance.

Appendix

# 0 ms After saving new content has been invoked.
# 0.109 ms Executing the rule A1_Rule on rule set After saving new content
# 0.395 ms Action execution: A1
# 0.528 ms Saved variable created content of type node.
#  * 34.912 ms After updating existing content has been invoked.
    * 35.018 ms Executing the rule A2_Rule on rule set After updating existing content
    * 35.297 ms Action execution: A2
    * 35.422 ms Saved variable updated content of type node.
    *    o 66.191 ms After updating existing content has been invoked.
          o 66.295 ms Not executing the rule A2_Rule on rule set After updating existing content to prevent recursion.
          o 66.361 ms Evaluation of After updating existing content has been finished.
    * 67.46 ms Evaluation of After updating existing content has been finished.

# 67.946 ms Evaluation of After saving new content has been finished

Comments

mitchell’s picture

mitchell’s picture

Component: Miscellaneous » Rules Core

Updated component.