From ff7601188fbbbaeccd6d1349b78dfca5d50c3c32 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 28 Jun 2010 12:36:10 +0000 Subject: [PATCH] Fix category search when category ID is sent as an array in (addressbook advanced search) --- addressbook/inc/class.addressbook_sql.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addressbook/inc/class.addressbook_sql.inc.php b/addressbook/inc/class.addressbook_sql.inc.php index 65cab23046..8b5aad9e3f 100644 --- a/addressbook/inc/class.addressbook_sql.inc.php +++ b/addressbook/inc/class.addressbook_sql.inc.php @@ -246,6 +246,12 @@ class addressbook_sql extends so_sql_cf $owner = isset($filter['owner']) ? $filter['owner'] : (isset($criteria['owner']) ? $criteria['owner'] : null); + // fix cat_id criteria to search in comma-separated multiple cats and return subcats + if (($cats = $criteria['cat_id'])) + { + $criteria += $this->_cat_search($criteria['cat_id'],$not); + unset($criteria['cat_id']); + } // fix cat_id filter to search in comma-separated multiple cats and return subcats if (($cats = $filter['cat_id'])) {