From cc0b0a4c9aedf1b03463719a2a72ea4613470222 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Fri, 21 Mar 2014 14:18:40 +0100 Subject: [PATCH] Correct call to AddressBook->getChild() --- lib/addressbookprovider.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/addressbookprovider.php b/lib/addressbookprovider.php index 124b440d..031fb8cf 100644 --- a/lib/addressbookprovider.php +++ b/lib/addressbookprovider.php @@ -175,6 +175,10 @@ class AddressbookProvider implements \OCP\IAddressBook { */ public function createOrUpdate($properties) { $id = null; + + /** + * @var \OCA\Contacts\VObject\VCard + */ $vcard = null; if(array_key_exists('id', $properties)) { // TODO: test if $id belongs to this addressbook @@ -191,7 +195,7 @@ class AddressbookProvider implements \OCP\IAddressBook { $uid = substr(md5(rand().time()), 0, 10); $vcard->add('UID', $uid); try { - $id = $this->addressBook->addChild($this->id, $vcard); + $id = $this->addressBook->addChild($vcard); } catch(\Exception $e) { \OCP\Util::writeLog('contacts', __METHOD__ . ' ' . $e->getMessage(), \OCP\Util::ERROR); return false;