From: Gunnar Wrobel
Date: Mon, 6 Apr 2009 06:11:20 +0000 (+0200) Subject: Allow setting the id of a basic object. Fixed a typo. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=84e790b091611c786665986c8ac12bcc97a13e9f;p=horde.git Allow setting the id of a basic object. Fixed a typo. --- diff --git a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object.php b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object.php index 52206e83d..e9af97305 100644 --- a/framework/Kolab_Server/lib/Horde/Kolab/Server/Object.php +++ b/framework/Kolab_Server/lib/Horde/Kolab/Server/Object.php @@ -401,6 +401,9 @@ class Horde_Kolab_Server_Object */ public static function generateId($info) { + if (!empty($info[self::ATTRIBUTE_ID])) { + return $info[self::ATTRIBUTE_ID]; + } return hash('sha256', uniqid(mt_rand(), true)); } @@ -428,7 +431,7 @@ class Horde_Kolab_Server_Object } if (!$this->exists()) { - foreach ($this->attribute_map['required'] as $attribute) { + foreach ($this->attribute_map['required'] as $key) { if (!in_array($key, array_keys($info)) || empty($info[$key])) { if (empty($this->attributes[$key]['default'])) { throw new Horde_Kolab_Server_Exception(sprintf(_("The value for \"%s\" is empty but required!"),