diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index b1306205df3f195fa00028a8b53f7d0d9da9a820..3254160230906983fa4b92a90926e35faff05212 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -5,6 +5,8 @@ Calendar Module 7.x
Version 7.x-3.x-dev
===================
+- Issue #1537598, Fix misc errors in day display caused when some items were not getting rendered due to a badly placed 'continue' in the loop.
+
======================
Version 7.x-3.1
======================
diff --git a/theme/calendar-day-overlap.tpl.php b/theme/calendar-day-overlap.tpl.php
index 2350f73c5f8903073b6076e8b68793a617a8ccdf..3b3bf4f6bf36a17187b7e524ee29b4a9856edf0f 100644
--- a/theme/calendar-day-overlap.tpl.php
+++ b/theme/calendar-day-overlap.tpl.php
@@ -111,7 +111,13 @@
diff --git a/theme/theme.inc b/theme/theme.inc
index 5d092205f58754ba6f7a5367f12ce393ffd85a0e..2ccb7e15b18d7c32c3da844f03a4c1d991a937f2 100644
--- a/theme/theme.inc
+++ b/theme/theme.inc
@@ -263,22 +263,26 @@ function template_preprocess_calendar_day(&$vars) {
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
foreach ($grouped_items[$start_time]['values'] as $column => &$items) {
foreach ($items as $index => &$item) {
+ $group_time = NULL;
+ $divisor = NULL;
if ($display_overlap) {
- if ($view->date_info->style_groupby_times == 'half'){
+ if ($view->style_options['groupby_times'] == 'half') {
$group_time = 30;
$divisor = 7.5;
}
- else if ($view->date_info->style_groupby_times == 'hour'){
+ elseif ($view->style_options['groupby_times'] == 'hour') {
$group_time = 60;
$divisor = 15;
- } else {
+ }
+ else {
$item->class = '';
- continue;
}
- $start_minute = intval(substr($start_time, 3, 2));
- $offset = round((date_format($item->date_start, 'i') - $start_minute) / $divisor);
- $duration = round(($item->date_end->format('U') - $item->date_start->format('U')) / 60 / $divisor);
- $item->class = 'd_' . $duration . ' o_' . $offset . ' i_' . $item->indent . ' md_' . min($item->max_depth, 5);
+ if (!empty($group_time) && !empty($divisor)) {
+ $start_minute = intval(substr($start_time, 3, 2));
+ $offset = round((date_format($item->date_start, 'i') - $start_minute) / $divisor);
+ $duration = round(($item->date_end->format('U') - $item->date_start->format('U')) / 60 / $divisor);
+ $item->class = 'd_' . $duration . ' o_' . $offset . ' i_' . $item->indent . ' md_' . min($item->max_depth, 5);
+ }
}
$grouped_items[$start_time]['values'][$column][$index] = theme('calendar_item', array('view' => $view, 'rendered_fields' => $item->rendered_fields, 'item' => $item));
}