I have two rules.

The first publishes a revision via the revisioning module.

The second changes a cck value once the revision is published.

These cannot be combined because when they are, the task performed in #2 is done against the wrong revision - i.e. although the revision is published, the 'old' revision (which up to then was the 'live' one) gets the cck value change.

However, similarly, when they are two separate tasks as I have defined above, the second task doesn't execute at all - i.e. it evaluates to false. See the debug info below. More comments follow after.

  • 0 ms "Workflow state has changed" has been invoked.
  • 0.116 ms Executing the rule "When content is changed to Approved workflow state, publish it" on rule set "Workflow state has changed"
  • 0.339 ms Condition "Check workflow transition from Any state to Approved" evaluated to TRUE.
  • 0.491 ms Action execution: "Publish the most recent pending revision"
  • 6.473 ms Included MODULE.rules_defaults.inc files.
    • 16.172 ms "Pending revision has been published" has been invoked.
    • 16.272 ms Executing the rule "Pending revision has been published, set Doc Status to Approved" on rule set "Pending revision has been published"
    • 16.711 ms Loaded variable "current revision of target content"
    • 16.801 ms Condition "Revision status of current revision of target content is: Current, published" evaluated to FALSE.
    • 16.875 ms Evaluation of "Pending revision has been published" has been finished.
  • 16.971 ms Evaluation of "Workflow state has changed" has been finished.

So you can see that although the revision is published, rules doesn't think it has, presumably because the second item is nested.

My question is - how can I force the second item to fire after the first completes?

OR

how can I make rules recognize that the condition (Condition "Revision status of current revision of target content is: Current, published") should evaluate to TRUE?

Comments

rconstantine’s picture

Title: Force rule to fire after another - i.e. eliminate nesting » Nested rule evals to FALSE, should be TRUE
Component: Rules Core » Rules Engine

Changing to a better title that doesn't result in my being told to use weights - since that isn't the issue.

BTW, solving this will probably solve the issue I had in combining the rules in the first place.

rconstantine’s picture

I think this has to do with this: http://drupal.org/node/204479

As you can tell from my paste of debug code above, I'm using the revisioning module. Calling node_save affects the 'current' (live) revision as handled by the revisioning module, when it should affect the latest revision.

If I can't get what I need another way, perhaps I'll look into making workflow more generally compatible with revisioning - or just revisions.

I'll post comments on that issue.

TR’s picture

Component: Rules Engine » Rules Core
Status: Active » Closed (outdated)

If this is still a problem with the current version of Rules (7.x-2.x or 8.x-3.x), please open a new issue with details about how to reproduce the error.