From e227c3c4c3facecb69112553b07dc672ed4a5a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Lehrke?= Date: Tue, 9 Feb 2010 10:48:18 +0000 Subject: [PATCH] address moreData conflict between datastores --- phpgwapi/inc/horde/Horde/SyncML/Command/Alert.php | 6 ++++-- .../inc/horde/Horde/SyncML/Sync/RefreshFromServerSync.php | 7 +++++++ phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php | 7 +++++++ phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php | 7 +++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/horde/Horde/SyncML/Command/Alert.php b/phpgwapi/inc/horde/Horde/SyncML/Command/Alert.php index 85670dc277..89c2c0eac5 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Command/Alert.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Command/Alert.php @@ -285,8 +285,10 @@ class Horde_SyncML_Command_Alert extends Horde_SyncML_Command { $synctype != ALERT_ONE_WAY_FROM_CLIENT && $synctype != ALERT_ONE_WAY_FROM_SERVER) { $serverAnchorLast = 0; - if (!$anchormatch) { - // Erase existing map: + if (isset($GLOBALS['egw_info']['user']['preferences']['syncml']['slowsync_ignore_map']) && + $GLOBALS['egw_info']['user']['preferences']['syncml']['slowsync_ignore_map'] + || !$anchormatch) { + // Erase existing map $state->removeAllUID($this->_targetLocURI); } } diff --git a/phpgwapi/inc/horde/Horde/SyncML/Sync/RefreshFromServerSync.php b/phpgwapi/inc/horde/Horde/SyncML/Sync/RefreshFromServerSync.php index 1575017f19..5a6a46cd89 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Sync/RefreshFromServerSync.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Sync/RefreshFromServerSync.php @@ -39,6 +39,13 @@ class Horde_SyncML_Sync_RefreshFromServerSync extends Horde_SyncML_Sync_TwoWaySy if (isset($state->curSyncItem)) { // Finish the pending sync item $cmd = &$state->curSyncItem; + if (!is_a($cmd, 'Horde_SyncML_Command_Sync_ContentSyncElement')) { + // Conflict with other datastore + Horde :: logMessage("SyncML: handleSync($currentCmdID, $hordeType, $syncType) moreData conflict found", + __FILE__, __LINE__, PEAR_LOG_DEBUG); + $state->setSyncStatus(SERVER_SYNC_DATA_PENDING); + return $currentCmdID; + } unset($state->curSyncItem); $currentCmdID = $cmd->outputCommand($currentCmdID, $output, 'Sync'); diff --git a/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php b/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php index e698c58c99..f7a96e5a50 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php @@ -47,6 +47,13 @@ class Horde_SyncML_Sync_SlowSync extends Horde_SyncML_Sync_TwoWaySync { if (isset($state->curSyncItem)) { // Finish the pending sync item $cmd = &$state->curSyncItem; + if (!is_a($cmd, 'Horde_SyncML_Command_Sync_ContentSyncElement')) { + // Conflict with other datastore + Horde :: logMessage("SyncML: handleSync($currentCmdID, $hordeType, $syncType) moreData conflict found", + __FILE__, __LINE__, PEAR_LOG_DEBUG); + $state->setSyncStatus(SERVER_SYNC_DATA_PENDING); + return $currentCmdID; + } unset($state->curSyncItem); $currentCmdID = $cmd->outputCommand($currentCmdID, $output, 'Sync'); diff --git a/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php b/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php index 1e8eae1d8d..6ede36367c 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php @@ -62,6 +62,13 @@ class Horde_SyncML_Sync_TwoWaySync extends Horde_SyncML_Sync { if (isset ($state->curSyncItem)) { // Finish the pending sync item $cmd = & $state->curSyncItem; + if (!is_a($cmd, 'Horde_SyncML_Command_Sync_ContentSyncElement')) { + // Conflict with other datastore + Horde :: logMessage("SyncML: handleSync($currentCmdID, $hordeType, $syncType) moreData conflict found", + __FILE__, __LINE__, PEAR_LOG_DEBUG); + $state->setSyncStatus(SERVER_SYNC_DATA_PENDING); + return $currentCmdID; + } unset ($state->curSyncItem); $currentCmdID = $cmd->outputCommand($currentCmdID, $output, 'Sync');