When hook_cron is called, i am getting the following error:

Fatal error: Call to undefined method DeleteQuery::range() in sites/all/modules/contrib/session_expire/session_expire.module on line 112

Actually, the DeleteQuery object does not support the range() method. So trying to use SESSION_EXPIRE_MAX_DELETIONS is always failing.

Comments

laurentchardin’s picture

Status: Active » Needs review
StatusFileSize
new2.49 KB

Patch attached with:
- adding missing constants: SESSION_EXPIRE_INTERVAL
- revamped session_expire_cron() method

laurentchardin’s picture

Fixing missing return carriage.

timaholt’s picture

Here is an expanded patch that adds the ability to define the interval again into the admin section. I feel like for users with minimal administrative logins (but with aggressive expire times like 15 minutes) you want it to run it during each cron run, instead of only running once a day. This contains all the above work from laurentchardin but adds this back to the admin section. Also I cleaned up a couple of changes that were made to spacing in the original patch.

caschbre’s picture

I had included the latest dev version in an installation profile and was receiving this error during the installation process.

I haven't tested everything in the patch, however I can confirm that #3 does allow me to get through the installation process without error.

caschbre’s picture

Issue summary: View changes

Small rephrasing

shrop’s picture

Issue summary: View changes

I tested #3 and it works well. Fixes both errors I was having:

Error: Call to undefined method DeleteQuery::range() in /var/www/sites/all/modules/contrib/session_expire/session_expire.module, line 111

and

Notice: Use of undefined constant SESSION_EXPIRE_INTERVAL - assumed 'SESSION_EXPIRE_INTERVAL' in session_expire_cron() (line 95 of /var/www/sites/all/modules/contrib/session_expire/session_expire.module).

The new cron interval admin setting also works well for me.

shrop’s picture

Status: Needs review » Reviewed & tested by the community

  • Commit 49c6eb5 on 7.x-1.x authored by timaholt, committed by deekayen:
    Issue #1832200 by laurentchardin, timaholt: Error in session_expire_cron...
deekayen’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

szecsodimlaszlo’s picture

This commit was not included in the last dev release (7.x-1.0-alpha1+5-dev / April 7, 2014 - 15:19).

Dev release needs to be rebuilt.