}
}
- /**
- * Fill the group contact cache if it is empty.
- *
- * Do this by the expensive operation of loading all groups. Call sparingly.
- */
- public static function fillIfEmpty() {
- if (!CRM_Core_DAO::singleValueQuery("SELECT COUNT(id) FROM civicrm_group_contact_cache")) {
- self::loadAll();
- }
- }
-
/**
* Build the smart group cache for a given group.
*
if (!empty($_GET['update_smart_groups'])) {
CRM_Contact_BAO_GroupContactCache::loadAll();
}
- else {
- CRM_Contact_BAO_GroupContactCache::fillIfEmpty();
+ elseif (!CRM_Core_DAO::singleValueQuery("SELECT id FROM civicrm_group_contact_cache LIMIT 1")) {
+ CRM_Core_Session::setStatus(ts('Count data for smart groups is not currently calculated. You may click Update Smart Groups to generate it. Be aware this can cause significant server load'));
}
$this->search();