From: Gunnar Wrobel
Date: Thu, 9 Apr 2009 20:14:33 +0000 (+0200) Subject: Check if a modification might lead to renaming the object. Rename if required. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=907e6c700dac19d9dc400c0e344a4d81e8936588;p=horde.git Check if a modification might lead to renaming the object. Rename if required. Fix collapsing attributes if none of the attributes to collapse have been set. --- diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object.php index 9e7e95e3d..2a7158512 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object.php @@ -409,6 +409,9 @@ class Horde_Kolab_Server_Object break; } } + if ($empty == 0) { + return; + } ksort($attributes); $unset = $attributes; $result = ''; @@ -620,6 +623,16 @@ class Horde_Kolab_Server_Object $key)); } } + + /* Check for potential renaming of the object here */ + $new_info = array_merge($this->_cache, $info); + $new_uid = $this->server->generateServerUid(get_class($this), + $this->generateId($new_info), + $new_info); + if ($new_uid != $this->uid) { + $this->server->rename($this->uid, $new_uid); + $this->uid = $new_uid; + } } $result = $this->server->save($this->uid, $info, $this->exists());