diff --git a/plugins/calendar/drivers/kolab/kolab_driver.php b/plugins/calendar/drivers/kolab/kolab_driver.php index d4a3436a..e414b871 100644 --- a/plugins/calendar/drivers/kolab/kolab_driver.php +++ b/plugins/calendar/drivers/kolab/kolab_driver.php @@ -899,12 +899,16 @@ class kolab_driver extends calendar_driver else if ($old['recurrence']['EXCEPTIONS']) $event['recurrence']['EXCEPTIONS'] = $old['recurrence']['EXCEPTIONS']; + // remove some internal properties which should not be saved + unset($event['_savemode'], $event['_fromcalendar'], $event['_identity'], $event['_owner'], + $event['_notify'], $event['_method'], $event['_sender'], $event['_sender_utf'], $event['_size']); + switch ($savemode) { case 'new': // save submitted data as new (non-recurring) event $event['recurrence'] = array(); $event['uid'] = $this->cal->generate_uid(); - unset($event['recurrence_id'], $event['id'], $event['_savemode'], $event['_fromcalendar'], $event['_identity'], $event['_notify']); + unset($event['recurrence_id'], $event['_instance'], $event['id']); // copy attachment data to new event foreach ((array)$event['attachments'] as $idx => $attachment) { @@ -921,16 +925,13 @@ class kolab_driver extends calendar_driver // recurring instances shall not store recurrence rules and attachments $event['recurrence'] = array(); $event['thisandfuture'] = $savemode == 'future'; - unset($event['attachments']); + unset($event['attachments'], $event['id']); // increment sequence of this instance if scheduling is affected if ($reschedule) { $event['sequence'] = max($old['sequence'], $master['sequence']) + 1; } - // remove some internal properties which should not be saved - unset($event['id'], $event['_savemode'], $event['_fromcalendar'], $event['_identity'], $event['_notify']); - // save properties to a recurrence exception instance if ($old['recurrence_id'] && is_array($master['recurrence']['EXCEPTIONS'])) { foreach ($master['recurrence']['EXCEPTIONS'] as $i => $exception) { diff --git a/plugins/libcalendaring/libcalendaring.php b/plugins/libcalendaring/libcalendaring.php index c3bf6256..63a05488 100644 --- a/plugins/libcalendaring/libcalendaring.php +++ b/plugins/libcalendaring/libcalendaring.php @@ -1414,7 +1414,7 @@ class libcalendaring extends rcube_plugin if (!empty($object['recurrence_date']) && is_a($object['recurrence_date'], 'DateTime')) { $recurrence_id_format = $object['allday'] ? 'Ymd' : 'Ymd\THis'; $object['_instance'] = $object['recurrence_date']->format($recurrence_id_format); - $object['_savemode'] = $event['thisandfuture'] ? 'future' : 'current'; + $object['_savemode'] = $object['thisandfuture'] ? 'future' : 'current'; } else if (!empty($object['recurrence_id']) || !empty($object['_instance'])) { if (strlen($object['_instance']) > 4) { diff --git a/plugins/libkolab/lib/kolab_format_event.php b/plugins/libkolab/lib/kolab_format_event.php index fe10f9d6..a5b0f737 100644 --- a/plugins/libkolab/lib/kolab_format_event.php +++ b/plugins/libkolab/lib/kolab_format_event.php @@ -103,7 +103,6 @@ class kolab_format_event extends kolab_format_xcal foreach((array)$object['recurrence']['EXCEPTIONS'] as $i => $exception) { $exevent = new kolab_format_event; $exevent->set(($compacted = $this->compact_exception($exception, $object))); // only save differing values - console('COMPACTED', $compacted); // get value for recurrence-id if (!empty($exception['recurrence_date']) && is_a($exception['recurrence_date'], 'DateTime')) {