I'm trying to use rules to send an email to the revision author when a revision is published.

I've upgraded to the latest development version (7.x-1.2+31-dev) and I'm using the latest release version of rules (7.x-2.0).

When I set up a rule and try and use any of the following tokens:current-revision:author,target-author:name I get an error message, e.g.
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'revisioning_events_argument_current_revision' not found or invalid function name in RulesState->get() (line 148 of ...\htdocs\drupal\sites\all\modules\rules\includes\rules.state.inc).

Comments

rdeboer’s picture

Hi Mary,
Initially I thought I could reproduce your error, but now I can't.
Can you please provide full details on exactly what rule you created, i.e Event, Condition and Action?
Thanks,
Rik

mpelder’s picture

Hi Rik,

This is what I'm doing. It's a little messy, so please bear with me.

I have a test system which is using version 7.x-1.2 of revisioning and 7.x-2.0-beta1 of rules. I saw the previous issue about tokens (http://drupal.org/node/1356404) and made the edit in comment three so that I could see the tokens.

I set up a simple rule as follows
Event: Pending revision has been published
No conditions
Action: Send mail. In the message body I am using the following: "This is the current author:[current_revision:author]"
When I publish a pending revision, the rule fires and generates the error below.
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'revisioning_events_argument_current_revision' not found or invalid function name in RulesState->get() (line 146 of ..../sites/all/modules/rules/includes/rules.state.inc).

I changed the rule to use "This is the node author:[node:author]"
This works, but as I need to email the author of the revision, not the person who originally created the node, it doesn't actually do what I need it to.

So I took another look at the releases and saw that you've done a lot of work around rules in the latest dev release, so installed this and the latest release of rules on my local install. I can't use mail on that, so I set it up to display a message instead:
Event: Pending revision has been published
No conditions
Action: Show a message on the site. The message is "The author of current revision is: [current-revision:author]".
When I publish a pending revision, the rule fires and generates the error below.
Warning: call_user_func() expects parameter 1 to be a valid callback, function 'revisioning_events_argument_current_revision' not found or invalid function name in RulesState->get() (line 148 of ....\sites\all\modules\rules\includes\rules.state.inc).
I changed the rule to use "This is the node author:[node:author]"
This works.

So I'm getting the same behaviour with both versions of revisioning. I'm quite new to this, so if I'm doing something completely wrong, apologies.

Thanks,
Mary

rdeboer’s picture

@Mary, #2:

Thanks for your detailed description, wish more Drupalers would do that!
I have reproduced the behaviour you describe above.
I'm on to it!
Watch this space...
Rik

rdeboer’s picture

Assigned: Unassigned » rdeboer
Status: Active » Fixed

Checked in a fix to Git.
Will be available as the latest development snapshot at 11:30pm UK time. Will be dated 25-Jan-2012 or later.

mpelder’s picture

Thanks!

clare-ux’s picture

Hi, I have installed the lastest dev snapshot but still am not able to use revisioning tokens in rules. wondering if maybe its a Rules or Token issue? I have the following rule:

event: on before save
conditions: if content is of type: various content types
content has pending revision
entity has field
data comparison on that field

actions: send mail
using the token [current-author:revision] in the message text.

I get a message that says:
User warning: Attempting to perform token replacement for token type revision without required data in token_tokens() (line 791 of /liveperson/code/drupal/html/sites/all/modules/token/token.tokens.inc).

rdeboer’s picture

Will check later when near a computer, but off the top of my head, I think you need to pick a Revisioning-specific event to be able to use Revisioning-specific tokens?....
Also the name of the token is [current_revision:author]

rdeboer’s picture

Try again with the latest development snapshot of Revisioning and Drupal core 7.12.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.