From 9e8a74b92e824f968afefe6d52e3d72ee02f5f72 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 14 Apr 2010 08:49:49 +0000 Subject: [PATCH] "fixed not working caching to avoid multiple reads of same event from database (condition !$date stoped caching for all non-repeating events)" --- calendar/inc/class.calendar_bo.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/calendar/inc/class.calendar_bo.inc.php b/calendar/inc/class.calendar_bo.inc.php index 62af9b9b3f..7875e23592 100644 --- a/calendar/inc/class.calendar_bo.inc.php +++ b/calendar/inc/class.calendar_bo.inc.php @@ -779,7 +779,7 @@ class calendar_bo { if (is_array($ids) || !isset(self::$cached_event['id']) || self::$cached_event['id'] != $ids || self::$cached_event_date_format != $date_format || - self::$cached_event['recur_type'] != MCAL_RECUR_NONE && !is_null($date) && self::$cached_event_date != $date || (!$date || self::$cached_event['start'] < $date)) + self::$cached_event['recur_type'] != MCAL_RECUR_NONE && self::$cached_event_date != $date) { $events = $this->so->read($ids,$date ? $this->date2ts($date,true) : 0); @@ -802,7 +802,7 @@ class calendar_bo } else { - $return =& self::$cached_event; + $return = self::$cached_event; } } if ($this->debug && ($this->debug > 1 || $this->debug == 'read')) @@ -855,7 +855,7 @@ class calendar_bo } $ts_end = $ts + $event_length; - + // adjust ts_end for whole day events in case it does not fit due to // spans over summer/wintertime adjusted days if($event['whole_day'] && ($arr_end = $this->date2array($ts_end)) && @@ -874,7 +874,7 @@ class calendar_bo $ts_end = $ts_end_guess; // $ts_end_guess was ok } } - + $event['start'] = $ts; $event['end'] = $ts_end; $events[] = $event;