Points are never expired if cron is called more than once a day

NITEMAN - March 25, 2009 - 19:41
Project:User Points Contributed modules
Version:5.x-3.0
Component:Code: userpoints_expire
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

First of all excuse me for my bad english and for the fact that I can only point the bug but my knoweldge isn't enought to provide a fix for it.

When the function userpoints_expire_cron() is called the first line causes it to do nothing if cron_last is more recent than a day

<?php
if (time() - variable_get('cron_last', 0) > 86400) {
?>

I guess probably another variable is needed to store last time points where expired.

Thanks in advance for any help with this.

#1

medieval111 - May 8, 2009 - 06:19

I changed it to:

<?php
 
if (time() - variable_get('userpoints_expire_lastcron', 0) > 86400) {
    
variable_set('userpoints_expire_lastcron', time());
     ...
?>

Now at least it works.

#2

kbahey - May 8, 2009 - 14:37
Status:active» fixed

Fixed in -dev and will be in the tarball tonight.

#3

System Message - May 22, 2009 - 14:40
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.