I've been testing the Rules module in conjunction with some contributed modules that support Rules like Userpoints (http://drupal.org/project/userpoints) and Janrain Engage (http://drupal.org/project/rpx). When I create an action (such as 'Send a mail') on a module-specific event (such as 'User was awarded points' for the Userpoints module), I'm not seeing any available replacement patterns except ones for 'Site information'.

I do see, however, the $userpoints_transaction variable available under 'PHP evaluation' (and I can successfully use it with PHP).

And I do seem to remember Userpoints replacement patterns being available previously on the action.

So is it possible that some recent Rules/Entity change made replacement tokens not available for objects declared with hook_rules_data_info() ?

Thanks,
Ben

Comments

fago’s picture

Title: No replacement tokens available for objects declared with hook_rules_data_info() » Add token replacement support for non-entities
Component: Rules Core » Rules Engine
Category: bug » task

>And I do seem to remember Userpoints replacement patterns being available previously on the action.

hm, I doubt that, because I've not implemented that feature yet ;) Shouldn't be hard though, as we could basically do the same as entity_tokens does for entities. Maybe another module provided the tokens though.

BenK’s picture

Hey fago,

Thanks for the clarification. Yes, this would be a very helpful feature for a lot of the contributed modules I work on that have Rules integration. We're always wanting to include module-related tokens in the triggered Rules action (especially actions that involve displaying or sending messages).

Once there is a patch in the works, let me know and I am happy to manually test and report back.

Cheers,
Ben

berdir’s picture

Subscribe and cross-reference #958288: Add replacement patterns within Rules for Userpoints transactions. According to that issue over there, it did never work.

As an alternative, will rules.module pick up existing "normal" tokens if the type matches?

fago’s picture

yep, of course. Rules just runs usual token replacements.

berdir’s picture

Ok, working on that.

Short question, sorry for hijacking the issue, failed to catch you in IRC :)

Is there a reason you're not using the fancy token-browser widget from token.module when it's available other than "Nobody implemented it"?

It looks like your table doesn't pick up recursive tokens nor can you insert them into the textfield/area by simply clicking on them. Especially the first is a bummer, because it really limits the usability of the whole thing.

I can write a patch if you're interested...

fago’s picture

>Is there a reason you're not using the fancy token-browser widget from token.module when it's available other than "Nobody implemented it"?

No. ;)

>I can write a patch if you're interested...
That would be great! Let's just make use of it if the token module is available.

berdir’s picture

fago’s picture

Status: Active » Closed (duplicate)