From 1b05b82e20014de63e5b82d33fa3344ba85b0068 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 12 Sep 2011 11:05:51 +0000 Subject: [PATCH] Do NOT move start- and end-date, to the earliest exception, as they will NOT be found in CalDAV or ActiveSync, because we only recognice recuring events which start before or in the current timerange and end in or after it or have no end-date. --> give an error message, as it is a debuging/support nightmare, if this gets silently fixed when reading events. No idea how this situation (exceptions before startdate) can be created anyway. --- calendar/inc/class.calendar_so.inc.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/calendar/inc/class.calendar_so.inc.php b/calendar/inc/class.calendar_so.inc.php index 11390c0cf0..90694929b3 100644 --- a/calendar/inc/class.calendar_so.inc.php +++ b/calendar/inc/class.calendar_so.inc.php @@ -200,9 +200,15 @@ class calendar_so sort($event['recur_exception']); if ($event['recur_exception'][0] < $event['start']) { - // leading exceptions => move start and end - $event['end'] -= $event['start'] - $event['recur_exception'][0]; - $event['start'] = $event['recur_exception'][0]; + /* Do NOT move start- and end-date, to the earliest exception, as they will NOT be found in CalDAV or ActiveSync, because + * we only recognice recuring events which start before or in the current timerange and end in or after it or have no end-date. + * --> give an error message, as it is a debuging/support nightmare, if this get's silently fixed when reading events. + * No idea how this situation (exceptions before startdate) can be created anyway. + * + * $event['end'] -= $event['start'] - $event['recur_exception'][0]; + * $event['start'] = $event['recur_exception'][0]; + */ + error_log(__METHOD__."() recuring event #$event[id]: $event[title] has exceptions before it's startdate ".date('Y-m-d H:i:s',$event['start'])); } } }