From c33e01a5cabb9b1cdd6336bb1d4497af6845e41d Mon Sep 17 00:00:00 2001 From: monishdeb Date: Tue, 17 Jun 2014 18:47:50 +0530 Subject: [PATCH] CRM-14864 fix - Advanced search - bug in contact type filters OR https://issues.civicrm.org/jira/browse/CRM-14864 --- CRM/Contact/BAO/Query.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 25b1aa86ad..f36c295a79 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -1532,6 +1532,9 @@ class CRM_Contact_BAO_Query { } $result = array($id, 'IN', $values, 0, 0); } + elseif ($id == 'contact_type') { + $result = array($id, 'IN', $values, 0, $wildcard); + } else { $result = array($id, '=', $values, 0, $wildcard); } @@ -2627,11 +2630,11 @@ class CRM_Contact_BAO_Query { // fix for CRM-771 if (!empty($clause)) { + $quill = $clause; if ($op == 'IN' || $op == 'NOT IN') { $this->_where[$grouping][] = "contact_a.contact_type $op (" . implode(',', $clause) . ')'; } else { - $quill = $clause; $type = array_pop($clause); $this->_where[$grouping][] = "contact_a.contact_type $op $type"; } -- 2.25.1