From e34dbaa077decd11fd39bd1e81eb1b0106aa6b9f Mon Sep 17 00:00:00 2001 From: Civiware Solutions Date: Tue, 4 Sep 2018 18:00:15 +0100 Subject: [PATCH] fix for search builder --- CRM/ConstituentsOnly/BAO/Query.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/ConstituentsOnly/BAO/Query.php b/CRM/ConstituentsOnly/BAO/Query.php index 782087a..8b99bce 100644 --- a/CRM/ConstituentsOnly/BAO/Query.php +++ b/CRM/ConstituentsOnly/BAO/Query.php @@ -15,7 +15,7 @@ class CRM_ConstituentsOnly_BAO_Query extends CRM_Contact_BAO_Query_Interface { public function select(&$query) { // hack for profile search $url = CRM_Utils_Array::value('q', $_GET); - if ($url == 'civicrm/profile') { + if (in_array($url, ['civicrm/profile', 'civicrm/contact/search/builder'])) { if (empty($query->_params)) { $query->_params[] = [ 'entryURL', @@ -44,7 +44,7 @@ class CRM_ConstituentsOnly_BAO_Query extends CRM_Contact_BAO_Query_Interface { return; } - if (CRM_Utils_Array::value('civicrm_contact', $query->_tables)) { + if (CRM_Utils_Array::value('civicrm_contact', $query->_tables) && empty($query->_paramLookup['do_not_trade'])) { $query->_where[0][] = "( contact_a.do_not_trade IS NULL OR contact_a.do_not_trade = 0)"; } }