Skip to content

Commit

Permalink
Remove early return on joinTable
Browse files Browse the repository at this point in the history
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
  • Loading branch information
eileenmcnaughton committed Nov 4, 2019
1 parent c796d7a commit 688e7a0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions CRM/Core/BAO/CustomQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 688e7a0

Please sign in to comment.