From 688e7a0d262d8331c5e4092023b55c7f0984e0b6 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 4 Nov 2019 14:05:30 +1300 Subject: [PATCH] Remove early return on joinTable I looked up the reason for the early return here and it was that the UI for adding other tables in was too complex. In other words the removed lines should never be true. However, I don't think it's the place of the query object to enforce not attempting a query the UI struggles with. Removing this will save a later person having to figure that out --- CRM/Core/BAO/CustomQuery.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CRM/Core/BAO/CustomQuery.php b/CRM/Core/BAO/CustomQuery.php index a3e2cf273677..776d2554eca9 100644 --- a/CRM/Core/BAO/CustomQuery.php +++ b/CRM/Core/BAO/CustomQuery.php @@ -148,7 +148,7 @@ public function getFields() { * @param array $locationSpecificFields */ public function __construct($ids, $contactSearch = FALSE, $locationSpecificFields = []) { - $this->_ids = &$ids; + $this->_ids = $ids; $this->_locationSpecificCustomFields = $locationSpecificFields; $this->_select = []; @@ -222,10 +222,6 @@ public function select() { $this->_select[$fieldName] = "{$field['table_name']}.{$field['column_name']} as $fieldName"; $this->_element[$fieldName] = 1; $joinTable = $field['search_table']; - // CRM-14265 - if ($joinTable == 'civicrm_group' || empty($joinTable)) { - return; - } $this->joinCustomTableForField($field);