From 33e8f690c387c8af87babf2bfcf2542cb817c0b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cornelius=20Wei=C3=9F?= Date: Mon, 2 Jul 2007 18:34:48 +0000 Subject: [PATCH] fix: SyncML produced dublets, due to the map command when entries come from client --- phpgwapi/inc/horde/Horde/SyncML/Command/Map.php | 3 ++- phpgwapi/inc/horde/Horde/SyncML/State_egw.php | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/horde/Horde/SyncML/Command/Map.php b/phpgwapi/inc/horde/Horde/SyncML/Command/Map.php index 1c2d4c8200..264682de77 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Command/Map.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Command/Map.php @@ -137,7 +137,8 @@ class Horde_SyncML_Command_Map extends Horde_SyncML_Command { Horde::logMessage("SyncML: creating Map for source=" . $this->_mapSource . " and target=" . $this->_mapTarget, __FILE__, __LINE__, PEAR_LOG_DEBUG); // Overwrite existing data by removing it first: - $r = $state->setUID($this->_targetLocURI, $this->_mapSource, $this->_mapTarget); + $ts = $state->getServerAnchorNext($this->_targetLocURI); + $r = $state->setUID($this->_targetLocURI, $this->_mapSource, $this->_mapTarget, $ts); if (is_a($r, 'PEAR_Error')) { Horde::logMessage('SyncML: PEAR Error: ' . $r->getMessage(), __FILE__, __LINE__, PEAR_LOG_ERR); return false; diff --git a/phpgwapi/inc/horde/Horde/SyncML/State_egw.php b/phpgwapi/inc/horde/Horde/SyncML/State_egw.php index d569e8d7bc..4490fb0c22 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/State_egw.php +++ b/phpgwapi/inc/horde/Horde/SyncML/State_egw.php @@ -366,11 +366,14 @@ class EGW_SyncML_State extends Horde_SyncML_State #if(count($guidParts) == 3) { # $guid = $GLOBALS['egw']->common->generate_uid($guidParts[0],$guidParts[1]); #} - + + // problem: entries created from client, come here with the (long) server guid, + // but getUIDMapping does not know them and can not map server-guid <--> client guid $guid = $this->getUIDMapping($_guid); if($guid === false) { Horde::logMessage("SyncML: setUID $type, $locid, $guid something went wrong!!! Mapping not found.", __FILE__, __LINE__, PEAR_LOG_INFO); - return false; + $guid = $_guid; + //return false; } Horde::logMessage("SyncML: setUID $_guid => $guid", __FILE__, __LINE__, PEAR_LOG_DEBUG); if($ts == 0) {