From f43482e49b44ecd60da4c8c17e574d562916bb6f Mon Sep 17 00:00:00 2001 From: Civiware Solutions Date: Thu, 30 Aug 2018 20:29:06 +0100 Subject: [PATCH] fix for profile search --- CRM/ConstituentsOnly/BAO/APIWrapper.php | 23 ----------------------- CRM/ConstituentsOnly/BAO/Query.php | 21 +++++++++++++++++++++ constituentsonly.php | 11 ----------- 3 files changed, 21 insertions(+), 34 deletions(-) delete mode 100644 CRM/ConstituentsOnly/BAO/APIWrapper.php diff --git a/CRM/ConstituentsOnly/BAO/APIWrapper.php b/CRM/ConstituentsOnly/BAO/APIWrapper.php deleted file mode 100644 index 7819b4f..0000000 --- a/CRM/ConstituentsOnly/BAO/APIWrapper.php +++ /dev/null @@ -1,23 +0,0 @@ -_params)) { + $query->_params[] = [ + 'entryURL', + '=', + 0, + 0, + 1, + ]; + } + $query->_paramLookup['entryURL'] = [ + 'entryURL', + '=', + 0, + 0, + 1, + ]; + } } /** @@ -21,6 +41,7 @@ class CRM_ConstituentsOnly_BAO_Query extends CRM_Contact_BAO_Query_Interface { if (empty($query->_paramLookup['entryURL'])) { return; } + 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)"; } diff --git a/constituentsonly.php b/constituentsonly.php index 6749d8b..cf3d251 100644 --- a/constituentsonly.php +++ b/constituentsonly.php @@ -134,17 +134,6 @@ function constituentsonly_civicrm_queryObjects(&$queryObjects, $type) { } } -/** - * Implements hook_civicrm_apiWrappers(). - * - * @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_apiWrappers - */ -function constituentsonly_civicrm_apiWrappers(&$wrappers, $apiRequest) { - if ($apiRequest['entity'] == 'Contact' && strtolower($apiRequest['action']) == 'getlist') { - $wrappers[] = new CRM_ConstituentsOnly_BAO_APIWrapper(); - } -} - /** * Implements hook_civicrm_contactListQuery(). *