A trigger of type 'user' cannot do token replacement because it provides $context['account'] instead of $context['user'].

Steps to reproduce the bug:
1. Create an action of type "display a message" and use the token [user:name] in the message.
2. Associate the action with a user-type token (like "After a user has logged in")
3. Make the trigger happen and look at the message. Token replacement hasn't happened.

What I expected: Token replacement.
What happened instead: No token replacement.

If I'm not mistaken, the attached patch is all that's required to fix this.

CommentFileSizeAuthor
#1 drupal.trigger_user_context.patch531 bytesrfay

Comments

rfay’s picture

StatusFileSize
new531 bytes

And a month later I discover that the patch never got uploaded!

andypost’s picture

Suppose this require a test, because [user:] token could use global $user and not the user from context

rfay’s picture

Status: Needs review » Needs work

Yes, I think it should get a test. Maybe several.

global $user
An account.

I'll get davereid to take a look too.

rfay’s picture

Status: Needs work » Closed (duplicate)