When a user has an expiration it is not possible to remove it - the checkbox stays checked.
I have confirmed the bug on a local install and additionally on simplytest.me. The problem is that in the function user_expire_set_expiration() there is a test on $account->is_new ("if (!isset($account->is_new))"). On my installs the value is always set to true or false, so the user expire delete code is never executed.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2377207_user_expire_delete_existing_values_if_unset.patch | 983 bytes | greggles |
| #1 | user_expire-remove_expiration_time-2377207-1.patch | 424 bytes | vurt |
Comments
Comment #1
vurt commentedI have attached a simple patch - maybe it should be a little more complex to avoid PHP warnings in the case that the filed is not set (which I could not reproduce).
Comment #2
seanbThis will throw an warning if the property doesn't exist. It is probably better to doe something like:
(!isset($account->is_new) || !$account->is_new)
Comment #3
vurt commentedIn in my tests $account->is_new was always set...
But you are correct - your way it is better to avoid potential problems. Thank you.
Comment #4
gregglesHere's a patch that combines the work of vurt in #1 and seanB's review in #2.
I've tested it and basically agree that looks right. Would love to get confirmation of that.
Comment #5
gregglesI walked through the scenarios one more time and this seems to perform properly.
Committed with credit for both of you as well. Thanks!