From 49285525349063aa8a85ed01c519cfcdcb696d2a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 21 Jan 2016 13:04:41 +0000 Subject: [PATCH] get so_sql_cf to read private customfields too, if we ignore acl --- addressbook/inc/class.addressbook_bo.inc.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/addressbook/inc/class.addressbook_bo.inc.php b/addressbook/inc/class.addressbook_bo.inc.php index c6a3353329..765a875207 100755 --- a/addressbook/inc/class.addressbook_bo.inc.php +++ b/addressbook/inc/class.addressbook_bo.inc.php @@ -1060,6 +1060,12 @@ class addressbook_bo extends addressbook_so */ function read($contact_id, $ignore_acl=false) { + // get so_sql_cf to read private customfields too, if we ignore acl + if ($ignore_acl && is_a($this->somain, 'addressbook_sql')) + { + $cf_backup = (array)$this->somain->customfields; + $this->somain->customfields = egw_customfields::get('addressbook', true); + } if (!($data = parent::read($contact_id))) { $data = null; // not found @@ -1081,6 +1087,10 @@ class addressbook_bo extends addressbook_so $data['adr_two_countryname'] = $GLOBALS['egw']->country->get_full_name($data['adr_two_countrycode'], true); } } + if (isset($cf_backup)) + { + $this->somain->customfields = $cf_backup; + } //error_log(__METHOD__.'('.array2string($contact_id).') returning '.array2string($data)); return $data; }