From 49f1d43ad1183642260a6a0deb7f1c22c8ea16fd Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 2 Oct 2012 16:43:49 +0000 Subject: [PATCH] * Calendar: fixed recuring event lost start-date, if single recurrence got deleted, also installed save-guard in case other code triggers that too caused by storing an event with unset start- or end-date, to not write it --- calendar/inc/class.calendar_boupdate.inc.php | 2 -- calendar/inc/class.calendar_so.inc.php | 12 +++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index ae28154ced..b10eca91f1 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -1481,8 +1481,6 @@ class calendar_boupdate extends calendar_bo $recur_date = $this->date2ts($event['start']); $event = $this->read($cal_id); $event['recur_exception'][] = $recur_date; - unset($event['start']); - unset($event['end']); $this->save($event); // updates the content-history } if ($event['reference']) diff --git a/calendar/inc/class.calendar_so.inc.php b/calendar/inc/class.calendar_so.inc.php index dcb4c2bfe5..1722e4a5fa 100644 --- a/calendar/inc/class.calendar_so.inc.php +++ b/calendar/inc/class.calendar_so.inc.php @@ -995,11 +995,13 @@ ORDER BY cal_user_type, cal_usre_id unset($event[$col]); } } - // set range_start/_end - $event['range_start'] = $event['cal_start']; - $event['range_end'] = $event['recur_type'] == MCAL_RECUR_NONE ? $event['cal_end'] : - ($event['recur_enddate'] ? $event['recur_enddate'] : null); - + // set range_start/_end, but only if we have cal_start/_end, as otherwise we destroy present values! + if (isset($event['cal_start'])) $event['range_start'] = $event['cal_start']; + if (isset($event['cal_end'])) + { + $event['range_end'] = $event['recur_type'] == MCAL_RECUR_NONE ? $event['cal_end'] : + ($event['recur_enddate'] ? $event['recur_enddate'] : null); + } // ensure that we find mathing entries later on if (!is_array($event['cal_category'])) {