From b1a9d0f546c01db72c071c4a2e6963091f5c8d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Lehrke?= Date: Mon, 28 Sep 2009 19:45:35 +0000 Subject: [PATCH] Fix issue with adding new entries from device --- phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php b/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php index c4a68e9ea1..74603ca96f 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php @@ -311,7 +311,11 @@ class Horde_SyncML_Sync_TwoWaySync extends Horde_SyncML_Sync { return $currentCmdID; } - $guid_ts = $state->getSyncTSforAction($guid, 'modify'); + // first we try the modification timestamp then the creation ts + if (!($guid_ts = $state->getSyncTSforAction($guid, 'modify'))) { + $guid_ts = $state->getSyncTSforAction($guid, 'add'); + } + $sync_ts = $state->getChangeTS($syncType, $guid); Horde :: logMessage("SyncML: timestamp add $guid guid_ts: $guid_ts sync_ts: $sync_ts", __FILE__, __LINE__, PEAR_LOG_DEBUG); if ($sync_ts && $sync_ts == $guid_ts) {