From: Coleman Watts Date: Sun, 18 Aug 2013 21:25:52 +0000 (-0700) Subject: Fix contact type search builder CRM-13242 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3b3bc8274d1965c5ba95792b653e1d50b15894e8;p=civicrm-core.git Fix contact type search builder CRM-13242 --- 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)) {