Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove early return on joinTable #15721

Merged
merged 1 commit into from
Nov 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
  • Loading branch information
eileenmcnaughton committed Nov 4, 2019
commit f2d54c7b1faec232386956a96c1d91bb552675b0
8 changes: 5 additions & 3 deletions CRM/Core/BAO/CustomQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ public function select() {

foreach (array_keys($this->_ids) as $id) {
$field = $this->_fields[$id];

if ($this->_contactSearch && $field['search_table'] === 'contact_a') {
CRM_Contact_BAO_Query::$_openedPanes[ts('Custom Fields')] = TRUE;
}

$name = $field['table_name'];
$fieldName = 'custom_' . $field['id'];
$this->_select["{$name}_id"] = "{$name}.id as {$name}_id";
Expand All @@ -241,9 +246,6 @@ public function select() {
if ($joinTable != 'contact_a') {
$this->_whereTables[$joinTableAlias] = $this->_tables[$joinTableAlias] = $joinClause;
}
elseif ($this->_contactSearch) {
CRM_Contact_BAO_Query::$_openedPanes[ts('Custom Fields')] = TRUE;
}
}
}
}
Expand Down