* Addressbook: Fix avatar photo gets removed when adding category to contact via contextmenu

This commit is contained in:
Hadi Nategh 2018-01-31 16:10:48 +01:00
parent 7ea83610e6
commit 1494d1a6e9

View File

@ -864,6 +864,10 @@ class Contacts extends Contacts\Storage
*/ */
function save(&$contact, $ignore_acl=false, $touch_modified=true) 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 // remember if we add or update a entry
if (($isUpdate = $contact['id'])) if (($isUpdate = $contact['id']))
{ {