0

I am working on a website and one (maybe more) rule is not being triggered.

The rule that is not working is as follows

Event:
After updating existing content
Condition:
Content is of type...
Actions:
Show a massage on the site...
...
More actions

I tried to reproduce the problem with a following rule

Event:
After updating existing content
Condition:
Content is of type...
Actions:
Show a massage on the site...

But it works.

The rule used to work. The portal is under development. There are many added modules. The rule weight is the same.

The only difference between the two rules is the name (I tried changing the name) and actions performed.

Any idea what can be wrong?

UPDATE I tried cloning the faulty rule and the clone does not work. Below I attach the code of the faulty and working rules.

Works

{ "rules_test_update_rule" : {
    "LABEL" : "test Update Rule",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules" ],
    "ON" : [ "node_update" ],
    "IF" : [
      { "node_is_of_type" : {
          "node" : [ "node" ],
          "type" : { "value" : { "test_case" : "test_case" } }
        }
      },
      { "data_is" : { "data" : [ "node:field-workflow-status:tid" ], "value" : "28" } },
      { "NOT data_is_empty" : { "data" : [ "node:field-workflow-reviewers" ] } }
    ],
    "DO" : [
      { "drupal_message" : { "message" : "Test case got updated", "type" : "warning" } }
    ]
  }
}

Does not work

{ "rules_tc_admin_review_v1" : {
    "LABEL" : "TC: admin review",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules", "privatemsg_rules", "windbench_workflow", "og" ],
    "ON" : [ "node_update" ],
    "IF" : [
      { "node_is_of_type" : {
          "node" : [ "node" ],
          "type" : { "value" : { "test_case" : "test_case" } }
        }
      },
      { "data_is" : { "data" : [ "node:field-workflow-status:tid" ], "value" : "28" } },
      { "NOT data_is_empty" : { "data" : [ "node:field-workflow-reviewers" ] } }
    ],
    "DO" : [
      { "drupal_message" : { "message" : "User has been notified.", "type" : "warning" } },

........ more in the "DO" section, should be irrelevant.....

  • Have you tried turning on the rules debug features? nodeone.se/en/debugging-rules-configuration – Patrick Kenny Nov 7 '12 at 15:34
  • Thanks, that's a useful tool. It seems the faulty rule never gets tested. I will go through all the custom functions that the rule is using, maybe there is a php error and the whole rule gets kicked off by drupal. Nothing else comes to my mind. – Pawel G Nov 7 '12 at 16:10
1

That is a weird one.

I don't know what caused the problem but the fix was to export and import the rule.

The interesting part is that cloning the rule did not work, even when I simplified/changed the cloned rule to

{ "rules_tc_admin_review_cloned_" : {
    "LABEL" : "TC: admin review (cloned)",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules" ],
    "ON" : [ "node_update" ],
    "DO" : []
  }
}

The rule was never checked. There seems to be a bug. Possibly in the rule cloning function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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