CRM-14439 - CRM_Core_Invoke::rebuildMenuAndCaches - Change order
authorTim Otten <totten@civicrm.org>
Tue, 8 Apr 2014 23:23:00 +0000 (16:23 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 8 Apr 2014 23:23:00 +0000 (16:23 -0700)
Currently, CRM_Core_Menu::store() truncates "civicrm_menu" and then refills
it; then, CRM_Core_Config::clearCaches (by-way-of clearDBCache) truncates
"civicrm_menu" without refilling.  This seems pointless.  (For CRM-14439,
this has the effect of producing an empty menu table after running setup.sh
-- so the table is eventually filled at some uncontrolled future point.)

The evident intent of "rebuildMenuAndCaches" is to truncate and then refill
the table, so this patch does that.

----------------------------------------
* CRM-14439: WP demo - Access denied when visiting breadcrumb links from field listing
  https://issues.civicrm.org/jira/browse/CRM-14439

CRM/Core/Invoke.php

index e1fe43347cacaaaec56294fc6ee905f3e4cfa671..7df01124bf0a3212513e0fbf6eb3fd182b3e980b 100644 (file)
@@ -483,14 +483,14 @@ class CRM_Core_Invoke {
     $config = CRM_Core_Config::singleton();
     $config->clearModuleList();
 
+    // also cleanup all caches
+    $config->cleanupCaches($sessionReset || CRM_Utils_Request::retrieve('sessionReset', 'Boolean', CRM_Core_DAO::$_nullObject, FALSE, 0, 'GET'));
+
     CRM_Core_Menu::store();
 
     // also reset navigation
     CRM_Core_BAO_Navigation::resetNavigation();
 
-    // also cleanup all caches
-    $config->cleanupCaches($sessionReset || CRM_Utils_Request::retrieve('sessionReset', 'Boolean', CRM_Core_DAO::$_nullObject, FALSE, 0, 'GET'));
-
     // also cleanup module permissions
     $config->cleanupPermissions();