actions provided by the token module, don't work with rules - as they get their objects out of the context - which is different when used with rules. So the tokens are not replaced for rules users - this doesn't matter much as rules has it's own, better integrated equivalent actions for sending mail, showing a message and redirect.

It's documented to not activate the token actions module for rules, however users often do so, make use of the actions and end up with not replaced tokens. To avoid that it'd be great if we could add this few loc to the module, which let rules ignore these actions.

Note that this would help avoiding a lot of unnecessary support issues (and users having headache..).

CommentFileSizeAuthor
rules_token_actions.patch1.36 KBfago

Comments

greggles’s picture

Status: Needs review » Needs work

I feel like this is a bug with rules that it allows users to associate actions with rules that won't work. Should this work the other way - either 1) that an action has to explicitly state it will work with rules or 2) that rules should provide the context in the manner that these actions expect it?

I know that's probably more work for you, but I don't really see why token should be adding code to fix a design flaw with rules being overly greedy in the kinds of actions it assumes will work without providing proper support for them.

Yes, token used to provide support for other contrib modules (i.e. cck) but cck and rules are not on the same level in terms of popularity...

fago’s picture

Status: Needs work » Closed (won't fix)

hm, I don't think rules overly greedy with supporting actions. The actions work, there is just not the "usual" context available, so the tokens don't work - although the token help is shown... I'm not sure it's right to rely on the context as it might look different for different hooks... I think the problem is the blurred definition of $context, which token actions relies on. What is set in $context and what not? It's no where specified and the action can't know really.. But this is probably more a problem of the core action system...

Anyway rules supports core actions of type 'system' in general - however as rules provides more powerful actions of the same kind itself, it hides the provided actions. Currently I know no single useful system action (for rules), so probably best I'll just drop support for these type of core actions and this problem is gone too.