Hi,
I am looking to support tokens for an object that isn't created until rules_action_callback(). The object's ID is set in rules_action_callback_form() using a select list.
I see that token replacements are done previously to rules_action_callback(). This forces me to do the token replacements within the rules_action_callback() function. In addition, because I'm not declaring any data_types, having my tokens show up in the token replacement patterns fieldset seems to only be possible through a hook_form_alter().
To provide a bit more details I am creating an awards module implemented through rules. There is no need to provide any events for this, only conditions and actions. For example, a user created a comment, the condition checks if this is the user's 10th comment and if so the action assigns them an award. It is the award I want to include tokens for.
Am I right in assuming only arguments provided in hook_rules_event_info() get used as tokens and that the only way to apply tokens from an object created after that is through a call to token_replace()? Perhaps there is a way of using the 'new variables' attribute or is that mainly for loading new content? I really want to use the proper rules integration techniques.
Comments
Comment #1
mitchell CreditAttribution: mitchell commentedDo the docs have this info?
Comment #2
TR CreditAttribution: TR commented