Skip to content

Commit

Permalink
Fix (hack) for dealing with too many events to process (esp. past eve…
Browse files Browse the repository at this point in the history
…nts), now displays 1st 500 and displays a message [#1029 state:resolved responsible:dleffler]

(cherry picked from commit 361c019)
  • Loading branch information
dleffler committed Jun 12, 2013
1 parent 77cddaa commit 4cfb0cd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion framework/modules/events/controllers/eventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,14 @@ function getEventsForDates($edates, $sort_asc = true, $featuredonly = false) {
$evs[$key]->color = $catcolor;
}
}
$events = array_merge($events, $evs);
if (count($events) < 500) { // magic number to not crash loop?
$events = array_merge($events, $evs);
} else {
// $evs[$key]->title = gt('Too many events to list').', '.(count($edates)-count($events)).' '.gt('not displayed!');
// $events = array_merge($events, $evs);
flash('notice',gt('Too many events to list').', '.(count($edates)-count($events)).' '.gt('not displayed!'));
break; // keep from breaking system by too much data
}
}
$events = expSorter::sort(array('array' => $events, 'sortby' => 'eventstart', 'order' => $sort_asc ? 'ASC' : 'DESC'));
return $events;
Expand Down

0 comments on commit 4cfb0cd

Please sign in to comment.