* Addressbook: fix for postgres error on advanced search in addressbook (Helpdesk 3421)

This commit is contained in:
Klaus Leithoff 2012-06-01 12:51:22 +00:00
parent d4c0a892cb
commit 4d70099c15

View File

@ -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))
{