}
}
+ /**
+ * FIXME: This function should not be needed, because the cache table should not be getting truncated
+ */
+ static function fillIfEmpty() {
+ if (!CRM_Core_DAO::singleValueQuery("SELECT COUNT(id) FROM civicrm_group_contact_cache")) {
+ self::loadAll();
+ }
+ }
+
/**
* @param $groupID
*/
$customClass =
CRM_Contact_BAO_SearchCustom::customClass($ssParams['customSearchID'], $savedSearchID);
$searchSQL = $customClass->contactIDs();
+ $searchSQL = str_replace('ORDER BY contact_a.id ASC', '', $searchSQL);
$idName = 'contact_id';
}
else {
$contactGroup[$prevContactID]['groupTitle'] = implode(', ', $contactGroup[$prevContactID]['groupTitle']);
}
- if (is_numeric($contactID)) {
+ if ((!empty($contactGroup[$contactID]) && is_numeric($contactID))) {
return $contactGroup[$contactID];
}
else {