Hi, I'd like to trigger a rule when a user of a certain role creates a new revision.
I hope this issue belongs here, if not I'll move it to Rules

This worked in D6 but in D7 the token node:author only checks the author of the original node and not the new revision.
So the Condition 'User has Role(s)' does not work.
Strangely this Condition offers the choice between node:author and node:source:author, suggesting that the former is the current revision but there seems to be no difference.

CommentFileSizeAuthor
#4 revision tokens.jpg139.11 KBrdeboer

Comments

rdeboer’s picture

Sorry this slipped off my radar.
Can someone please verify if this is still an issue with the latest versions of Rules (7.x-2.3) and Revisioning 7.x-1.x-dev?
Rik

rdeboer’s picture

Title: Rule node:author only works on original node » Rule node:author works on original node, not latest revision
Assigned: Unassigned » rdeboer
rdeboer’s picture

You need to distinguish between the author of the node, which is and will always remain the creator (of the first revision) of the node and the editor/author of the (latest) revision.
Token/Replacement Pattern support has been brushed up in the latest version of Revisioning 7.x-1.x-dev.

rdeboer’s picture

Title: Rule node:author works on original node, not latest revision » Solved: Replacement pattern: node:author works on original node, node:revision-author on revision
StatusFileSize
new139.11 KB

Attached a screenshot of the Revisioning-related tokens available as Replacement Patterns in Rules.
Revision tokens in Rules

rdeboer’s picture

Status: Active » Fixed
rdeboer’s picture

Title: Solved: Replacement pattern: node:author works on original node, node:revision-author on revision » Rules "User has role" condition to apply to author/editor of latest revision, not initial revision
Status: Fixed » Active

Reopening as I've misread the original issue, which is not so much about replacement patters, but about applying the "User has role" condition to the author/editor of the newly created revision (as opposed to the author of the initial revision).

This is not quite fixed yet. I can't seem to get any event arguments to become available in the evaluation of the condition. They show up in the UI, but the objects don't in the code...

Anyone any ideas?

PS: as a workaround, couldn't you use the role of the "Acting user" instead?

arrubiu’s picture

I've this problem with token also in actions.
I'v tried to create a rule with action "Pending revision is published" and a simple action "set message on the site" with text "Thanks [revision:author"].

The rule returns an error about missing of "node" argument.

sgurley314’s picture

I'm confused about the status of this issue. Is it a bug with the code or an error in configuration on the user's part?

I have a similar/the same problem in my system. My site has a list of approvers of content (about 5 people - any of which can approve). I would like them all to get an email when a revision is published and ready for review. Nothing I do works. Either I get an error as described above or it runs error free and no email is sent. Any ideas?

sgurley314’s picture

I should add - the error I get is "Revisioning: could not evaluate rule condition -- node variable missing"

rdeboer’s picture

The code is incomplete. See comment #6: https://drupal.org/node/1566848#comment-7296838
Anyone want to chip in?