Fix deleting events by first occurrence (T1214)

This commit is contained in:
Aleksander Machniak 2016-04-20 09:28:25 -04:00
parent 84c29a5b91
commit 345506712e
2 changed files with 8 additions and 3 deletions

View file

@ -193,7 +193,7 @@ class kolab_calendar extends kolab_storage_folder_api
// directly access storage object // directly access storage object
if (!$this->events[$id] && $master_id == $id && ($record = $this->storage->get_object($id))) { if (!$this->events[$id] && $master_id == $id && ($record = $this->storage->get_object($id))) {
$this->events[$id] = $this->_to_driver_event($record, true); $this->events[$id] = $this->_to_driver_event($record);
} }
// maybe a recurring instance is requested // maybe a recurring instance is requested
@ -201,7 +201,7 @@ class kolab_calendar extends kolab_storage_folder_api
$instance_id = substr($id, strlen($master_id) + 1); $instance_id = substr($id, strlen($master_id) + 1);
if ($record = $this->storage->get_object($master_id)) { if ($record = $this->storage->get_object($master_id)) {
$master = $this->_to_driver_event($record, true); $master = $this->_to_driver_event($record);
$this->events[$master_id] = $master; $this->events[$master_id] = $master;
} }
@ -216,6 +216,11 @@ class kolab_calendar extends kolab_storage_folder_api
} }
else if (is_array($master['recurrence'])) { else if (is_array($master['recurrence'])) {
$this->get_recurring_events($record, $master['start'], null, $id); $this->get_recurring_events($record, $master['start'], null, $id);
// above does not resolve first occurence on the start date (T1214)
if (empty($this->events[$id]) && $instance_id === libcalendaring::recurrence_instance_identifier($master)) {
$this->events[$id] = $master;
}
} }
} }
} }

View file

@ -897,7 +897,7 @@ class kolab_driver extends calendar_driver
break; break;
} }
} }
if ($success && $this->freebusy_trigger) if ($success && $this->freebusy_trigger)
$this->rc->output->command('plugin.ping_url', array('action' => 'calendar/push-freebusy', 'source' => $storage->id)); $this->rc->output->command('plugin.ping_url', array('action' => 'calendar/push-freebusy', 'source' => $storage->id));