From 213833f3224c7de130ec36a94515e6625fe1492f Mon Sep 17 00:00:00 2001 From: Civiware Solutions Date: Thu, 30 Aug 2018 17:04:52 +0100 Subject: [PATCH] added search fix --- CRM/ConstituentsOnly/BAO/Query.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CRM/ConstituentsOnly/BAO/Query.php b/CRM/ConstituentsOnly/BAO/Query.php index d23c644..b9e033a 100644 --- a/CRM/ConstituentsOnly/BAO/Query.php +++ b/CRM/ConstituentsOnly/BAO/Query.php @@ -18,14 +18,12 @@ class CRM_ConstituentsOnly_BAO_Query extends CRM_Contact_BAO_Query_Interface { * @access public */ public function where(&$query) { - $grouping = 0; - $statement = "NOT (contact_a.do_not_trade <=> 1)"; - $query->_where[$grouping][] = $statement; + if (CRM_Utils_Array::value('civicrm_contact', $query->_tables)) { + $query->_where[0][] = "( contact_a.do_not_trade IS NULL OR contact_a.do_not_trade = 0)"; + } } public function from($name, $mode, $side) { - $from = NULL; - return $from; } public function setTableDependency(&$tables) {