diff --git a/plugins/libkolab/lib/kolab_format.php b/plugins/libkolab/lib/kolab_format.php index fefef1bc..be2a0b87 100644 --- a/plugins/libkolab/lib/kolab_format.php +++ b/plugins/libkolab/lib/kolab_format.php @@ -415,7 +415,7 @@ abstract class kolab_format $this->obj->setLastModified(self::get_datetime($object['changed'])); // Save custom properties of the given object - if (isset($object['x-custom'])) { + if (isset($object['x-custom']) && method_exists($this->obj, 'setCustomProperties')) { $vcustom = new vectorcs; foreach ((array)$object['x-custom'] as $cp) { if (is_array($cp)) @@ -423,7 +423,8 @@ abstract class kolab_format } $this->obj->setCustomProperties($vcustom); } - else { // load custom properties from XML for caching (#2238) + // load custom properties from XML for caching (#2238) if method exists (#3125) + else if (method_exists($this->obj, 'customProperties')) { $object['x-custom'] = array(); $vcustom = $this->obj->customProperties(); for ($i=0; $i < $vcustom->size(); $i++) { @@ -456,10 +457,12 @@ abstract class kolab_format } // read custom properties - $vcustom = $this->obj->customProperties(); - for ($i=0; $i < $vcustom->size(); $i++) { - $cp = $vcustom->get($i); - $object['x-custom'][] = array($cp->identifier, $cp->value); + if (method_exists($this->obj, 'customProperties')) { + $vcustom = $this->obj->customProperties(); + for ($i=0; $i < $vcustom->size(); $i++) { + $cp = $vcustom->get($i); + $object['x-custom'][] = array($cp->identifier, $cp->value); + } } // merge with additional data, e.g. attachments from the message