fix: SyncML produced dublets, due to the map command when entries come from client

This commit is contained in:
Cornelius Weiß 2007-07-02 18:34:48 +00:00
parent 2ce3929f46
commit 33e8f690c3
2 changed files with 7 additions and 3 deletions

View File

@ -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;

View File

@ -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) {