From 868c3ad8ecf1cfee5f0b187abe9d848546f716e1 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Mon, 15 Jul 2019 09:06:40 +1000 Subject: [PATCH] Remove additional custom fields deletegroup functions Add comment about state of GenerateReportData file --- sql/GenerateData.php | 3 ++- sql/GenerateReportData.php | 34 ++++++++++++---------------------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/sql/GenerateData.php b/sql/GenerateData.php index 2809fa382d..ebd098bdd4 100644 --- a/sql/GenerateData.php +++ b/sql/GenerateData.php @@ -1195,7 +1195,8 @@ class CRM_GCD { //In this function when we add groups that time we are cache the contact fields //But at the end of setup we are appending sample custom data, so for consistency //reset the cache. - CRM_Core_BAO_Cache::deleteGroup('contact fields'); + Civi::cache('fields')->flush(); + CRM_Core_BAO_Cache::resetCaches(); } /** diff --git a/sql/GenerateReportData.php b/sql/GenerateReportData.php index dd74843a02..e3b1dfd332 100644 --- a/sql/GenerateReportData.php +++ b/sql/GenerateReportData.php @@ -88,29 +88,19 @@ * */ +/* + * Note as of 2019-07-15 this file does not appear to be called + * from anywhere and seems to have issues running on more recent + * php versions. + * @todo look to remove this file completely. + */ + require_once '../civicrm.config.php'; -require_once 'CRM/Core/Config.php'; -require_once 'CRM/Core/Error.php'; -require_once 'CRM/Core/I18n.php'; - -require_once 'CRM/Core/DAO/Address.php'; -require_once 'CRM/Core/DAO.php'; -require_once 'CRM/Core/DAO/Phone.php'; -require_once 'CRM/Core/DAO/Email.php'; -require_once 'CRM/Core/DAO/EntityTag.php'; -require_once 'CRM/Core/DAO/Note.php'; -require_once 'CRM/Core/DAO/Domain.php'; - -require_once 'CRM/Contact/DAO/Group.php'; -require_once 'CRM/Contact/DAO/GroupContact.php'; -require_once 'CRM/Contact/DAO/SubscriptionHistory.php'; -require_once 'CRM/Contact/DAO/Contact.php'; -require_once 'CRM/Contact/DAO/Relationship.php'; -require_once 'CRM/Event/DAO/Participant.php'; -require_once 'CRM/Contribute/DAO/ContributionSoft.php'; -require_once 'CRM/Member/DAO/MembershipPayment.php'; +// autoload +require_once 'CRM/Core/ClassLoader.php'; +CRM_Core_ClassLoader::singleton()->register(); /** * Class CRM_GCD @@ -1173,8 +1163,8 @@ class CRM_GCD { //In this function when we add groups that time we are cache the contact fields //But at the end of setup we are appending sample custom data, so for consistency //reset the cache. - require_once 'CRM/Core/BAO/Cache.php'; - CRM_Core_BAO_Cache::deleteGroup('contact fields'); + Civi::cache('fields')->flush(); + CRM_Core_BAO_Cache::resetCaches(); } /** -- 2.25.1