From 189de3dddad600ce9984d703b22213039816a92d Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 31 Jan 2018 16:10:48 +0100 Subject: [PATCH] * Addressbook: Fix avatar photo gets removed when adding category to contact via contextmenu --- api/src/Contacts.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/src/Contacts.php b/api/src/Contacts.php index 20269b7816..e00889ee5d 100755 --- a/api/src/Contacts.php +++ b/api/src/Contacts.php @@ -864,6 +864,10 @@ class Contacts extends Contacts\Storage */ function save(&$contact, $ignore_acl=false, $touch_modified=true) { + // Make sure photo remains unchanged unless its purposely set to be false + // which means photo has changed. + if (!array_key_exists('photo_unchanged',$contact)) $contact['photo_unchanged'] = true; + // remember if we add or update a entry if (($isUpdate = $contact['id'])) {