From feeb6864823f9a1d13555613e3738861f5cb2535 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Fri, 29 Mar 2013 16:44:44 +0100 Subject: [PATCH] Contacts: Add new multiproperty if it doesn't exist. --- lib/contact.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/contact.php b/lib/contact.php index 71d2f24b..a6287134 100644 --- a/lib/contact.php +++ b/lib/contact.php @@ -393,7 +393,12 @@ class Contact extends VObject\VCard implements IPIMObject { * @return string new checksum */ public function setPropertyByChecksum($checksum, $name, $value, $parameters=array()) { - $property = $this->getPropertyByChecksum($checksum); + if($checksum === 'new') { + $property = Property::create($name); + $this->add($property); + } else { + $property = $this->getPropertyByChecksum($checksum); + } switch($name) { case 'EMAIL': $value = strtolower($value);