From 3b3bc8274d1965c5ba95792b653e1d50b15894e8 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 18 Aug 2013 14:25:52 -0700 Subject: [PATCH] Fix contact type search builder CRM-13242 --- CRM/Contact/BAO/Query.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index ea7e41a501..381d671171 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -2441,7 +2441,13 @@ class CRM_Contact_BAO_Query { // fix for CRM-771 if (!empty($clause)) { - $this->_where[$grouping][] = 'contact_a.contact_type IN (' . implode(',', $clause) . ')'; + if ($op == 'IN' || $op == 'NOT IN') { + $this->_where[$grouping][] = "contact_a.contact_type $op (" . implode(',', $clause) . ')'; + } + else { + $type = array_pop($clause); + $this->_where[$grouping][] = "contact_a.contact_type $op $type"; + } $this->_qill[$grouping][] = ts('Contact Type') . ' - ' . implode(' ' . ts('or') . ' ', $clause); if (!empty($subTypes)) { -- 2.25.1