Let me describe my goal: After a user creates a node, I want to assign the user a role which expires on the date provided by the user in the form.
I have a required CCK date field in the form, which the user completes. In my Rule, I add two actions, the first of which is simply assigning the role to the user. The second action is "add expire time to role". In the "Expiration time" field, I put the following token, which I grabbed from the "Token replacement patterns" fieldset on that same page: "[node:field_team_expiration-timestamp]". However, when I click "Save", I get the error, "Role expiration time is not in correct format."
I believe the problem is that the validation function in role_expire_rules_action_set_role_expire_validate() does not account for the token replacement. How do we fix this?
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | role_expire.rules.inc.patch | 538 bytes | joelstein |
Comments
Comment #1
joelstein commentedLet me clarify. The role_expire_rules_action_set_role_expire_validate() function works perfectly if I am creating a Rules action and providing a valid strtotime() value in the "Expiration time" field.
However, if I enter a value to be modified by an input validator (such as Token, or Rules' built-in PHP Evaluation), then the validation will fail, because it is specifically looking for a valid strtotime() value.
I recommend we simply remove that validation function. Attached is a patch which accomplished this goal.
Comment #2
geerlingguy commented+1 (subscribe)
Comment #3
amitaibuSeems reasonable.
Comment #4
stewsnoozeCommitted to CVS HEAD
Comment #5
stewsnoozeReleased in 6.x.1.7
Comment #6
stewsnoozeReleased in 6.x.1.7
Comment #8
btown commentedAm I missing something? The note above suggests there is a version 6.17 but the only version available on the project home page is 6.12. Sorry if this is an ill-informed question.
Comment #9
alexiswatson commentedThis was fixed in 6.x-1.7, not 6.x-1.17. :]