The only functions that call contactIDsSQl are 2 custom searches from my searching. One is disabled
I tested the Date Add search with calling the secondary function directly & it worked so the
contactIDsSql can go...
return NULL;
}
- /**
- * Contact IDS Sql (whatever that means!).
- *
- * @param int $id
- *
- * @return string
- */
- public static function contactIDsSQL($id) {
- $params = self::getSearchParams($id);
- if ($params && !empty($params['customSearchID'])) {
- return CRM_Contact_BAO_SearchCustom::contactIDSQL(NULL, $id);
- }
- else {
- $tables = $whereTables = ['civicrm_contact' => 1];
- $where = CRM_Contact_BAO_SavedSearch::whereClause($id, $tables, $whereTables);
- if (!$where) {
- $where = '( 1 )';
- }
- $from = CRM_Contact_BAO_Query::fromClause($whereTables);
- return "
-SELECT contact_a.id
-$from
-WHERE $where";
- }
- }
-
/**
* Deprecated function, gets a value from Group entity
*
if (in_array($values, $smartGroup)) {
$ssId = CRM_Utils_Array::key($values, $smartGroup);
- $smartSql = CRM_Contact_BAO_SavedSearch::contactIDsSQL($ssId);
+ $smartSql = CRM_Contact_BAO_SearchCustom::contactIDSQL(NULL, $ssId);
$smartSql = $smartSql . " AND contact_a.id NOT IN (
SELECT contact_id FROM civicrm_group_contact
$ssId = CRM_Utils_Array::key($values, $smartGroup);
- $smartSql = CRM_Contact_BAO_SavedSearch::contactIDsSQL($ssId);
+ $smartSql = CRM_Contact_BAO_SearchCustom::contactIDSQL(NULL, $ssId);
$smartSql .= " AND contact_a.id IN (
SELECT id AS contact_id
if (in_array($values, $smartGroup)) {
$ssId = CRM_Utils_Array::key($values, $smartGroup);
- $smartSql = CRM_Contact_BAO_SavedSearch::contactIDsSQL($ssId);
+ $smartSql = CRM_Contact_BAO_SearchCustom::contactIDSQL(NULL, $ssId);
$smartSql = $smartSql . " AND contact_a.id NOT IN (
SELECT contact_id FROM civicrm_group_contact
$ssId = CRM_Utils_Array::key($values, $smartGroup);
- $smartSql = CRM_Contact_BAO_SavedSearch::contactIDsSQL($ssId);
+ $smartSql = CRM_Contact_BAO_SearchCustom::contactIDSQL(NULL, $ssId);
$smartSql .= " AND contact_a.id NOT IN (
SELECT contact_id FROM civicrm_group_contact