Add workaround for situation when kolabobject doesn't generate UID but kolabformat does

(it's the case for File objects unsupported by libkolab)
This commit is contained in:
Aleksander Machniak 2013-01-16 10:06:59 +01:00
parent ddeb606daf
commit 80cf13f4ad

View file

@ -265,7 +265,12 @@ abstract class kolab_format
{
// get generated UID
if (!$this->data['uid']) {
$this->data['uid'] = $this->xmlobject ? $this->xmlobject->getSerializedUID() : kolabformat::getSerializedUID();
if ($this->xmlobject) {
$this->data['uid'] = $this->xmlobject->getSerializedUID();
}
if (empty($this->data['uid'])) {
$this->data['uid'] = kolabformat::getSerializedUID();
}
$this->obj->setUid($this->data['uid']);
}
}