if ($savedSearch['api_entity']) {
$sql = self::getApiSQL($savedSearch, $groupID);
}
- elseif (!empty($savedSearch['form_values']['customSearchID'])) {
+ elseif (!empty($savedSearch['search_custom_id'])) {
$sql = self::getCustomSearchSQL($savedSearch, $groupID);
}
else {
$tempTable = \CRM_Utils_SQL_TempTable::build();
$tempTable->createWithColumns('contact_id INT');
$tableName = $tempTable->getName();
- \CRM_Contact_BAO_GroupContactCache::populateTemporaryTableWithContactsInGroups($value, $tableName);
+ \CRM_Contact_BAO_GroupContactCache::populateTemporaryTableWithContactsInGroups((array) $value, $tableName);
// SQL optimization - use INNER JOIN if the base table is Contact & this clause is not nested
if ($fieldAlias === '`a`.`id`' && $operator === "IN" && !$depth) {
$query->getQuery()->join($tableName, "INNER JOIN `$tableName` ON $fieldAlias = `$tableName`.contact_id");
/>
<civicrm_saved_search
id="1"
+ search_custom_id="4"
form_values='a:9:{s:5:"qfKey";s:32:"0123456789abcdef0123456789abcdef";s:13:"includeGroups";a:1:{i:0;s:1:"3";}s:13:"excludeGroups";a:0:{}s:11:"includeTags";a:0:{}s:11:"excludeTags";a:0:{}s:4:"task";s:2:"14";s:8:"radio_ts";s:6:"ts_all";s:14:"customSearchID";s:1:"4";s:17:"customSearchClass";s:36:"CRM_Contact_Form_Search_Custom_Group";}'
/>
<civicrm_saved_search
id="2"
+ search_custom_id="4"
form_values='a:9:{s:5:"qfKey";s:32:"0123456789abcdef0123456789abcdef";s:13:"includeGroups";a:0:{}s:13:"excludeGroups";a:1:{i:0;s:1:"3";}s:11:"includeTags";a:0:{}s:11:"excludeTags";a:0:{}s:4:"task";s:2:"14";s:8:"radio_ts";s:6:"ts_all";s:14:"customSearchID";s:1:"4";s:17:"customSearchClass";s:36:"CRM_Contact_Form_Search_Custom_Group";}'
/>
<civicrm_group