Page MenuHomePhorge

D4457.1775245572.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D4457.1775245572.diff

diff --git a/lib/kolab_sync_data.php b/lib/kolab_sync_data.php
--- a/lib/kolab_sync_data.php
+++ b/lib/kolab_sync_data.php
@@ -490,7 +490,23 @@
*/
public function createEntry($folderId, Syncroton_Model_IEntry $entry)
{
- $entry = $this->toKolab($entry, $folderId);
+ // 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.
+ $existing = null;
+ try {
+ $foldername = $this->getFolderName($folderId);
+ $folder = $this->getFolderObject($foldername);
+ $existing = $folder->get_object($entry->uID);
+
+ if ($existing) {
+ $this->logger->debug('Found and existing entry for UID: ' . $entry->uID);
+ }
+ } catch (Exception $e) {
+ // uID is not available on exceptions, so we guard for that and silently ignore.
+ }
+
+ $entry = $this->toKolab($entry, $folderId, $existing);
$entry = $this->createObject($folderId, $entry);
if (empty($entry)) {

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 3, 7:46 PM (1 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18826125
Default Alt Text
D4457.1775245572.diff (1 KB)

Event Timeline