Commit 9ecd0e52 authored by Dries's avatar Dries

- Patch #997918 by David_Rothstein: menu gets rebuilt continually during...

- Patch #997918 by David_Rothstein: menu gets rebuilt continually during install and update (and menu system stores entire, out-of-date theme objects).
parent 571f3e52
......@@ -2566,10 +2566,7 @@ function menu_reset_static_cache() {
*
* This function will clear and populate the {menu_router} table, add entries
* to {menu_links} for new router items, then remove stale items from
* {menu_links}. If called from update.php or install.php, it will also
* schedule a call to itself on the first real page load from
* menu_execute_active_handler(), because the maintenance page environment
* is different and leaves stale data in the menu tables.
* {menu_links}.
*
* @return
* TRUE if the menu was rebuilt, FALSE if another thread was rebuilding
......@@ -2593,13 +2590,8 @@ function menu_rebuild() {
// Clear the menu, page and block caches.
menu_cache_clear_all();
_menu_clear_page_cache();
if (defined('MAINTENANCE_MODE')) {
variable_set('menu_rebuild_needed', TRUE);
}
else {
variable_del('menu_rebuild_needed');
}
// Indicate that the menu has been successfully rebuilt.
variable_del('menu_rebuild_needed');
}
catch (Exception $e) {
$transaction->rollback();
......
......@@ -148,7 +148,7 @@ function block_menu() {
'type' => $key == $default_theme ? MENU_DEFAULT_LOCAL_TASK : MENU_LOCAL_TASK,
'weight' => $key == $default_theme ? -10 : 0,
'access callback' => '_block_themes_access',
'access arguments' => array($theme),
'access arguments' => array($key),
'file' => 'block.admin.inc',
);
if ($key != $default_theme) {
......@@ -167,7 +167,7 @@ function block_menu() {
'page arguments' => array($key),
'type' => MENU_CALLBACK,
'access callback' => '_block_themes_access',
'access arguments' => array($theme),
'access arguments' => array($key),
'theme callback' => '_block_custom_theme',
'theme arguments' => array($key),
'file' => 'block.admin.inc',
......
......@@ -60,12 +60,6 @@ function field_ui_menu() {
'file' => 'field_ui.admin.inc',
);
// Ensure the following is not executed until field_bundles is working and
// tables are updated. Needed to avoid errors on initial installation.
if (defined('MAINTENANCE_MODE')) {
return $items;
}
// Create tabs for all possible bundles.
foreach (entity_get_info() as $entity_type => $entity_info) {
if ($entity_info['fieldable']) {
......
......@@ -635,13 +635,13 @@ function system_menu() {
'weight' => -1,
);
foreach (list_themes() as $theme) {
foreach (list_themes() as $key => $theme) {
$items['admin/appearance/settings/' . $theme->name] = array(
'title' => $theme->info['name'],
'page arguments' => array('system_theme_settings', $theme->name),
'type' => MENU_LOCAL_TASK,
'access callback' => '_system_themes_access',
'access arguments' => array($theme),
'access arguments' => array($key),
'file' => 'system.admin.inc',
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment