From d8a4acc01841fbad5966220678dd844bc9428d8b Mon Sep 17 00:00:00 2001 From: CiviCRM Date: Sat, 16 Mar 2013 09:34:10 -0400 Subject: [PATCH] CRM-11823 - D6/D7 - Clear theme registry, et al, as part of install/upgrade --- CRM/Upgrade/Form.php | 3 +++ CRM/Utils/System/Base.php | 8 ++++++++ CRM/Utils/System/Drupal.php | 8 ++++++++ CRM/Utils/System/Drupal6.php | 7 +++++++ install/index.php | 8 ++++---- 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/CRM/Upgrade/Form.php b/CRM/Upgrade/Form.php index ba7d885e85..566692ec5a 100644 --- a/CRM/Upgrade/Form.php +++ b/CRM/Upgrade/Form.php @@ -602,6 +602,9 @@ SET version = '$version' $upgrade->setVersion($rev); CRM_Utils_System::flushCache(); + $config = CRM_Core_Config::singleton(); + $config->userSystem->flush(); + if (version_compare($currentVer, '4.1.alpha1') >= 0) { CRM_Core_BAO_Setting::updateSettingsFromMetaData(); } diff --git a/CRM/Utils/System/Base.php b/CRM/Utils/System/Base.php index ef07c21888..5f7f1b7859 100644 --- a/CRM/Utils/System/Base.php +++ b/CRM/Utils/System/Base.php @@ -116,5 +116,13 @@ abstract class CRM_Utils_System_Base { $session->set('ufID', $ufID); $session->set('userID', $userID); } + + /** + * Reset any system caches that may be required for proper CiviCRM + * integration. + */ + function flush() { + // nullop by default + } } diff --git a/CRM/Utils/System/Drupal.php b/CRM/Utils/System/Drupal.php index 089a793ebb..0a7a78d056 100644 --- a/CRM/Utils/System/Drupal.php +++ b/CRM/Utils/System/Drupal.php @@ -1031,4 +1031,12 @@ AND u.status = 1 og_ungroup($ogID, 'user', user_load($drupalID)); } } + + /** + * Reset any system caches that may be required for proper CiviCRM + * integration. + */ + function flush() { + drupal_flush_all_caches(); + } } diff --git a/CRM/Utils/System/Drupal6.php b/CRM/Utils/System/Drupal6.php index 2181567417..451b0f73a9 100644 --- a/CRM/Utils/System/Drupal6.php +++ b/CRM/Utils/System/Drupal6.php @@ -924,5 +924,12 @@ SELECT name, mail } } + /** + * Reset any system caches that may be required for proper CiviCRM + * integration. + */ + function flush() { + drupal_flush_all_caches(); + } } diff --git a/install/index.php b/install/index.php index 8272ac4bd1..c1a0e0692f 100644 --- a/install/index.php +++ b/install/index.php @@ -1121,8 +1121,8 @@ class Installer extends InstallRequirements { // now enable civicrm module. module_enable(array('civicrm', 'civicrmtheme')); - // clear block and page cache, to make sure civicrm link is present in navigation block - cache_clear_all(); + // clear block, page, theme, and hook caches + drupal_flush_all_caches(); //add basic drupal permissions civicrm_install_set_drupal_perms(); @@ -1183,8 +1183,8 @@ class Installer extends InstallRequirements { // now enable civicrm module. module_enable(array('civicrm')); - // clear block and page cache, to make sure civicrm link is present in navigation block - cache_clear_all(); + // clear block, page, theme, and hook caches + drupal_flush_all_caches(); //add basic drupal permissions db_query('UPDATE {permission} SET perm = CONCAT( perm, \', access CiviMail subscribe/unsubscribe pages, access all custom data, access uploaded files, make online contributions, profile create, profile edit, profile view, register for events, view event info\') WHERE rid IN (1, 2)'); -- 2.25.1