From 4d70099c158841dd466e1ca760b17bcdd3cde0a8 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 1 Jun 2012 12:51:22 +0000 Subject: [PATCH] * Addressbook: fix for postgres error on advanced search in addressbook (Helpdesk 3421) --- addressbook/inc/class.addressbook_sql.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addressbook/inc/class.addressbook_sql.inc.php b/addressbook/inc/class.addressbook_sql.inc.php index 96bd0c25e5..dbfd978233 100644 --- a/addressbook/inc/class.addressbook_sql.inc.php +++ b/addressbook/inc/class.addressbook_sql.inc.php @@ -345,7 +345,7 @@ class addressbook_sql extends so_sql_cf $join .= self::ACCOUNT_ACTIVE_JOIN; $filter[] = str_replace('UNIX_TIMESTAMP(NOW())',time(),self::ACOUNT_ACTIVE_FILTER); } - if ($join || $criteria && is_string($criteria)) // search also adds a join for custom fields! + if ($join || ($criteria && is_string($criteria)) || ($criteria && is_array($criteria) && $order_by)) // search also adds a join for custom fields! { switch(gettype($only_keys)) {