}
}
+ /**
+ * 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
*/
$contactGroup[$prevContactID]['groupTitle'] = implode(', ', $contactGroup[$prevContactID]['groupTitle']);
}
- if (is_numeric($contactID)) {
+ if ((!empty($contactGroup[$contactID]) && is_numeric($contactID))) {
return $contactGroup[$contactID];
}
else {