From 0d8adb439d47d2f30fc0d4edee029f40d3145316 Mon Sep 17 00:00:00 2001
From: Angie Byron <webchick@24967.no-reply.drupal.org>
Date: Thu, 10 Sep 2009 22:10:10 +0000
Subject: [PATCH] #306316 follow-up by catch: Revert coupling of
 node_types_rebuild() and menu_rebuild().

---
 includes/common.inc             | 2 +-
 modules/node/content_types.inc  | 2 ++
 modules/node/node.module        | 2 --
 modules/system/system.admin.inc | 1 +
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/includes/common.inc b/includes/common.inc
index 781e27a9c59a..ff0acc58f537 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -5221,7 +5221,7 @@ function drupal_flush_all_caches() {
   }
 
   drupal_theme_rebuild();
-  // Rebuild content types, menu will be rebuilt as well.
+  menu_rebuild();
   node_types_rebuild();
   // Don't clear cache_form - in-progress form submissions may break.
   // Ordered so clearing the page cache will always be the last action.
diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc
index 2236090411b3..8a5adaf93ba4 100644
--- a/modules/node/content_types.inc
+++ b/modules/node/content_types.inc
@@ -350,6 +350,7 @@ function node_type_form_submit($form, &$form_state) {
   }
 
   node_types_rebuild();
+  menu_rebuild();
   $t_args = array('%name' => $type->name);
 
   if ($status == SAVED_UPDATED) {
@@ -444,6 +445,7 @@ function node_type_delete_confirm_submit($form, &$form_state) {
   watchdog('menu', 'Deleted content type %name.', $t_args, WATCHDOG_NOTICE);
 
   node_types_rebuild();
+  menu_rebuild();
 
   $form_state['redirect'] = 'admin/structure/types';
   return;
diff --git a/modules/node/node.module b/modules/node/node.module
index 62c11ce835a8..a9128ff88530 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -465,8 +465,6 @@ function node_types_rebuild() {
   // Reset cached node type information so that the next access
   // will use the updated data.
   node_type_clear();
-  // This is required for proper menu items at node/add/type.
-  menu_rebuild();
 }
 
 /**
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 2d1875e746c2..bd7f54effdee 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -1000,6 +1000,7 @@ function system_modules_submit($form, &$form_state) {
   registry_rebuild();
   drupal_theme_rebuild();
   node_types_rebuild();
+  menu_rebuild();
   cache_clear_all('schema', 'cache');
   cache_clear_all('entity_info', 'cache');
   drupal_clear_css_cache();
-- 
GitLab