From: eileen Date: Mon, 4 Nov 2019 01:05:30 +0000 (+1300) Subject: Remove early return on joinTable X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=688e7a0d262d8331c5e4092023b55c7f0984e0b6;p=civicrm-core.git 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 --- diff --git a/CRM/Core/BAO/CustomQuery.php b/CRM/Core/BAO/CustomQuery.php index a3e2cf2736..776d2554ec 100644 --- a/CRM/Core/BAO/CustomQuery.php +++ b/CRM/Core/BAO/CustomQuery.php @@ -148,7 +148,7 @@ class CRM_Core_BAO_CustomQuery { * @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 @@ SELECT f.id, f.label, f.data_type, $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);