From 9c976086cccfad6bb70e8c551d1f7cb9e29b17eb Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Wed, 20 Mar 2013 14:24:56 +0100 Subject: [PATCH] Only issue a 'delete' action if all copies of an object are gone Otherwise we just deleted a duplicated object or updated the original one. (An update results in an ADDED + DELETED folder action) --- .../Horde/Kolab/Storage/Data/Query/History/Base.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Data/Query/History/Base.php b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Data/Query/History/Base.php index f668eafce7f..ecee0b394d6 100644 --- a/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Data/Query/History/Base.php +++ b/framework/Kolab_Storage/lib/Horde/Kolab/Storage/Data/Query/History/Base.php @@ -95,9 +95,15 @@ public function synchronize($params = array()) foreach ($params['changes'][Horde_Kolab_Storage_Folder_Stamp::ADDED] as $bid => $object) { $this->_updateLog($prefix.$object['uid'], $bid, $stamp); } - foreach ($params['changes'][Horde_Kolab_Storage_Folder_Stamp::DELETED] as $bid => $object) { + foreach ($params['changes'][Horde_Kolab_Storage_Folder_Stamp::DELETED] as $bid => $object_uid) { + // Check if the object is really gone from the folder. + // Otherwise we just deleted a duplicated object or updated the original one. + // (An update results in an ADDED + DELETED folder action) + if ($this->data->objectIdExists($object_uid) == true) + continue; + $this->history->log( - $prefix.$object, array('action' => 'delete', 'bid' => $bid, 'stamp' => $stamp), true + $prefix.$object_uid, array('action' => 'delete', 'bid' => $bid, 'stamp' => $stamp), true ); } } else {