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.
Comments
Comment #1
rfayAnd a month later I discover that the patch never got uploaded!
Comment #2
andypostSuppose this require a test, because [user:] token could use global $user and not the user from context
Comment #3
rfayYes, I think it should get a test. Maybe several.
global $user
An account.
I'll get davereid to take a look too.
Comment #4
rfayMoving this work to #721086: Create tests for system actions, clean up token replacement, clean up triggers and marking this as duplicate.