From 9e2540eeb2ca9390636ef11ee00c46317c9522c1 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 22 Jan 2009 05:01:39 +0000 Subject: [PATCH] #306316 by beeradb: Rebuild the menu from node_types_rebuild() to assist with programmatic node creation. --- includes/common.inc | 2 +- modules/node/content_types.inc | 2 -- modules/node/node.module | 2 ++ modules/system/system.admin.inc | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/common.inc b/includes/common.inc index 66d41bb9cc5..2ecf25069fe 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -4042,7 +4042,7 @@ function drupal_flush_all_caches() { } drupal_theme_rebuild(); - menu_rebuild(); + // Rebuild content types, menu will be rebuilt as well. 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 3868c50f4ec..e3b0dea39aa 100644 --- a/modules/node/content_types.inc +++ b/modules/node/content_types.inc @@ -328,7 +328,6 @@ function node_type_form_submit($form, &$form_state) { } node_types_rebuild(); - menu_rebuild(); $t_args = array('%name' => $type->name); if ($op == t('Reset to defaults')) { @@ -413,7 +412,6 @@ 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/build/types'; return; diff --git a/modules/node/node.module b/modules/node/node.module index 25e10df9957..63ac460ad54 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -499,6 +499,8 @@ function node_types_rebuild() { } _node_types_build(); + // 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 652197793fb..afe65919cac 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -574,7 +574,6 @@ function system_modules($form_state = array()) { registry_rebuild(); drupal_theme_rebuild(); node_types_rebuild(); - menu_rebuild(); cache_clear_all('schema', 'cache'); // Get current list of modules. $files = module_rebuild_cache();