X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FBAO%2FGroupContactCache.php;h=a88d317325675d0aa44f7623b0036b4d1ed86331;hb=a5d44edbee5498fa4195c5f3571db6b820185fa8;hp=8ffeb2da1345347975c79d071ba829a444acf491;hpb=13982f7bd4d5598c51c264c3ec560dfad9b8347e;p=civicrm-core.git diff --git a/CRM/Contact/BAO/GroupContactCache.php b/CRM/Contact/BAO/GroupContactCache.php index 8ffeb2da13..a88d317325 100644 --- a/CRM/Contact/BAO/GroupContactCache.php +++ b/CRM/Contact/BAO/GroupContactCache.php @@ -190,6 +190,15 @@ AND g.refresh_date IS NULL } } + /** + * 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 */