Page MenuHomePhorge

D4457.1775313713.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D4457.1775313713.diff

diff --git a/lib/kolab_sync_data_calendar.php b/lib/kolab_sync_data_calendar.php
--- a/lib/kolab_sync_data_calendar.php
+++ b/lib/kolab_sync_data_calendar.php
@@ -345,8 +345,23 @@
*/
public function toKolab(Syncroton_Model_IEntry $data, $folderid, $entry = null, $timezone = null)
{
+ $foldername = isset($entry['_mailbox']) ? $entry['_mailbox'] : $this->getFolderName($folderid);
+ if (empty($entry)) {
+ // If we don't have an existing event (not a modification) we nevertheless check for conflicts.
+ // This is necessary so we don't overwrite the server-side copy in case the client did not have it available
+ // when generating an Add command.
+ try {
+ $folder = $this->getFolderObject($foldername);
+ $entry = $folder->get_object($data->uID);
+
+ if ($entry) {
+ $this->logger->debug('Found and existing event for UID: ' . $data->uID);
+ }
+ } catch (Exception $e) {
+ // uID is not available on exceptions, so we guard for that and silently ignore.
+ }
+ }
$event = !empty($entry) ? $entry : array();
- $foldername = isset($event['_mailbox']) ? $event['_mailbox'] : $this->getFolderName($folderid);
$config = $this->getFolderConfig($foldername);
$is_exception = $data instanceof Syncroton_Model_EventException;
$dummy_tz = str_repeat('A', 230) . '==';

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 4, 2:41 PM (10 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18829998
Default Alt Text
D4457.1775313713.diff (1 KB)

Event Timeline