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.

Comments

vurt’s picture

I 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).

seanb’s picture

+++ b/user_expire.module
@@ -209,7 +209,7 @@ function user_expire_set_expiration($acc
-    if (!isset($account->is_new)) {

This 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)

vurt’s picture

In in my tests $account->is_new was always set...
But you are correct - your way it is better to avoid potential problems. Thank you.

greggles’s picture

Status: Active » Needs review
StatusFileSize
new983 bytes

Here'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.

greggles’s picture

Status: Needs review » Fixed

I walked through the scenarios one more time and this seems to perform properly.

Committed with credit for both of you as well. Thanks!

  • greggles committed bd1221b on 7.x-1.x
    Issue #2377207 by vurt, greggles, seanB: Unable to remove expiration
    

Status: Fixed » Closed (fixed)

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