Problem/Motivation
My club needs a membership expiring on the 1st of November of every year, regardless of when you join.
According to the documentation, and looking at older issues (like #3036203), I should be able to use a strtotime relative date, like "first day of november", but instead I get the error "Role expiry default duration must be a relative strtotime-compatible string.".
Steps to reproduce
- Create or edit a role
- Set "first day of november" in the Default duration for the role field
- Save
Proposed resolution
Removing lines 92-95 from role_expire.module seems working as it should, setting the role expiration date to "Tue, 11/01/2022 - 00:00", which is the next occurrence of the 1st of November for this year, and it should work as well for the future years.
I expect the new expiration date will be set for the next occurrence (eg 1st Nov 2023), when I re-assign the role to the users who renewed their membership.
I wonder thought why this change has been introduced in the first place: the form currently accepts "first day of the next month", I'm unsure why it shouldn't accept the above syntax. The blame commit points to issue #2998705, but there's no real explanation given.
Remaining tasks
- Verify why this has been set like that.
- If not completely intentional, adjust the validation check or remove it
User interface changes
None
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | strtotime-check-3275802-4.patch | 705 bytes | elgandoz |
Comments
Comment #2
elgandoz commentedComment #3
elgandoz commentedComment #4
elgandoz commentedProposed temporary patch (removing check for absolute) attached