From 3cabeaf5bf1b7326331eb34e1b4fcba54d04576b Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 28 Jan 2019 10:01:12 +0100 Subject: [PATCH] do NOT try to read empty contact_id it wont find anything anyway, but gives an exception under AD, because of wrong formated GUID --- api/js/etemplate/et2_widget_image.js | 2 +- api/src/Contacts/Storage.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/api/js/etemplate/et2_widget_image.js b/api/js/etemplate/et2_widget_image.js index ac4789a4c6..da78a37553 100644 --- a/api/js/etemplate/et2_widget_image.js +++ b/api/js/etemplate/et2_widget_image.js @@ -527,7 +527,7 @@ var et2_avatar = (function(){ "use strict"; return et2_image.extend( { this._super.apply(this,arguments); var self = this; - if (this.options.editable) + if (this.options.contact_id && this.options.editable) { egw(window).json( 'addressbook.addressbook_ui.ajax_noPhotoExists', diff --git a/api/src/Contacts/Storage.php b/api/src/Contacts/Storage.php index 78c7ba8a32..dea939afbf 100755 --- a/api/src/Contacts/Storage.php +++ b/api/src/Contacts/Storage.php @@ -603,6 +603,10 @@ class Storage */ function read($contact_id) { + if (empty($contact_id)) + { + return false; // no need to pass to backend, will fail anyway + } if (!is_array($contact_id) && substr($contact_id,0,8) == 'account:') { $contact_id = array('account_id' => (int) substr($contact_id,8));