Permalink
Browse files

bugsquish! stats aggregates and weird missing dates bug

  • Loading branch information...
1 parent 10b6398 commit af5d9f6a06c5c755d468304b7f46e2387ce06c66 mjollnir_ committed Sep 25, 2006
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/statslib.php
View
@@ -317,6 +317,9 @@ function stats_cron_weekly () {
WHERE courseid = '.$course->id.' AND '.$timesql.' AND stattype = \'logins\'';
if ($stat = get_record_sql($sql)) {
+ if (empty($stat->stat1)) {
+ $stat->stat1 = 0;
+ }
$stat->courseid = $course->id;
$stat->roleid = 0;
$stat->timeend = $nextsunday;
@@ -443,6 +446,9 @@ function stats_cron_monthly () {
WHERE courseid = '.$course->id.' AND '.$timesql.' AND stattype = \'logins\'';
if ($stat = get_record_sql($sql)) {
+ if (empty($stat->stat1)) {
+ $stat->stat1 = 0;
+ }
$stat->courseid = $course->id;
$stat->roleid = 0;
$stat->timeend = $nextmonthend;
@@ -1021,7 +1027,7 @@ function stats_fix_zeros($stats,$timeafter,$timestr,$line2=true,$line3=false) {
$actualtimes[] = $s->timeend;
}
- $timeafter = array_pop($actualtimes);
+ $timeafter = array_pop(array_values($actualtimes));
while ($timeafter < $now) {
$times[] = $timeafter;

0 comments on commit af5d9f6

Please sign in to comment.