From 83562390030fc9e97c5df95a87476e15986974ea Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Tue, 23 Dec 2014 18:45:56 +0530 Subject: [PATCH] Fix for CRM-15750 advanced search using relationship and smart group produces backtrace --- 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