From 013198e90942d68e125adbb47235fc533899ff1d Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Wed, 4 Feb 2015 14:57:19 -0800 Subject: [PATCH] CRM-15750 - backporting fix to 4.5 ---------------------------------------- * CRM-15750: advanced search using relationship and smart group produces backtrace https://issues.civicrm.org/jira/browse/CRM-15750 --- CRM/Contact/BAO/Query.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 1620bb6ca1..79d9e99d19 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -2888,12 +2888,12 @@ WHERE id IN ( $groupIDs ) $groupIDsFiltered = implode(',', $groupsFiltered); if ($tableAlias == NULL) { - $tableAlias = "civicrm_group_contact_cache_{$groupIDsFiltered}"; + $tableAlias = "`civicrm_group_contact_cache_{$groupIDsFiltered}`"; } - $this->_tables["`{$tableAlias}`"] = $this->_whereTables["`{$tableAlias}`"] = " LEFT JOIN civicrm_group_contact_cache `{$tableAlias}` ON {$joinTable}.id = `{$tableAlias}`.contact_id "; + $this->_tables[$tableAlias] = $this->_whereTables[$tableAlias] = " LEFT JOIN civicrm_group_contact_cache {$tableAlias} ON {$joinTable}.id = {$tableAlias}.contact_id "; - return "`{$tableAlias}`.group_id IN (" . $groupIDsFiltered . ")"; + return "{$tableAlias}.group_id IN (" . $groupIDsFiltered . ")"; } return NULL; -- 2.25.1