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?

CommentFileSizeAuthor
#1 role_expire.rules.inc.patch538 bytesjoelstein

Comments

joelstein’s picture

Status: Active » Needs review
StatusFileSize
new538 bytes

Let 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.

geerlingguy’s picture

+1 (subscribe)

amitaibu’s picture

Status: Needs review » Reviewed & tested by the community

Seems reasonable.

stewsnooze’s picture

Committed to CVS HEAD

stewsnooze’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Released in 6.x.1.7

stewsnooze’s picture

Status: Closed (fixed) » Fixed

Released in 6.x.1.7

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

btown’s picture

Category: bug » support
Status: Closed (fixed) » Active

Am 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.

alexiswatson’s picture

Category: support » bug
Status: Active » Closed (fixed)

This was fixed in 6.x-1.7, not 6.x-1.17. :]