This may be me just doing something incorrectly, but I am unable to get rules to recognize my tokens.

I am trying to use a token during a userpoints transaction in rules, where the amount of points added to a user is equal to the value entered into a text area on a certain page. When the user hits "submit", the user's points should increase by whatever integer value they entered into the text area, but so far, this has not worked.

The rules event is "user is going to view a page", the condition I used for the rule is "check path" provided by the path rules module. The action is then to award [token global get-param-points] number of points to the user.

So far, no success.

Comments

neighborhoodsix’s picture

Is there something I need to do with rules to make the token available?

neighborhoodsix’s picture

I was just not entering the variable properly in rules. You have to use the format [user:get-param-XXXX], etc.

atheneus’s picture

Thanks for the follow-up. I'm glad you were able to figure it out, and I appreciate you contributing your discovery!

Yes - this module is purely a token provider and so the token should be available in any module that consumes and exposes tokens. Ideally, the token specification should be exposed so that tokens are included in lists of available tokens. This was not initially possible because there was no way of knowing what tokens a site developer might use. However, now that I have added the ability to specify what parameter keywords will be tokenized in the module settings I can use this to add those tokens to the list of available tokens. That means in the example of Rules the tokens you have specified should show up on the list of available tokens in Rules.

atheneus’s picture

Status: Active » Closed (works as designed)