From 7a5b2a59b13bf99a83729ca97c79e0d74c715222 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 3 Jun 2014 09:54:53 +0000 Subject: [PATCH] prevent SQL error if for what every reason an invalid org_view was set (eg. just a contact_id, instead of string starting with "org_name") --- addressbook/inc/class.addressbook_ui.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index 4c9a601688..75d213c672 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -732,7 +732,7 @@ class addressbook_ui extends addressbook_bo if ($name) $org_name[] = $name; } $org_name = implode(': ',$org_name); - return array($org => $org_name); + return $org_name ? array($org => $org_name) : array(); } /** @@ -1387,7 +1387,11 @@ window.egw_LAB.wait(function() { foreach(explode('|||',$query['org_view']) as $part) { list($name,$value) = explode(':',$part,2); - $query['col_filter'][$name] = $value; + // do NOT set invalid column, as this gives an SQL error ("AND AND" in sql) + if (in_array($name, array('org_name','org_unit','adr_one_location'))) + { + $query['col_filter'][$name] = $value; + } } } else if($query['actions'] && !$query['actions']['edit'])