----------------------------------------
* CRM-15750: advanced search using relationship and smart group produces backtrace
https://issues.civicrm.org/jira/browse/CRM-15750
$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;