Home ›
Saving the modules page no longer (necessarily) rebuilds menusSaving the modules page no longer (necessarily) rebuilds menus
Submitted by Benjamin Melançon on October 30, 2010 - 9:56pm
Searched words:
menu item not appearing
can't get page to show up
Drupal 7 not refreshing menus
Here's the code in system_modules_submit() - the function called when admin/modules is saved - that skips over flushing caches if no modules are enabled or disabled:
<?php
// Gets module list after install process, flushes caches and displays a
// message if there are changes.
$post_install_list = module_list(TRUE);
if ($pre_install_list != $post_install_list) {
drupal_flush_all_caches();
drupal_set_message(t('The configuration options have been saved.'));
}
?>
So, drupal_flush_all_caches() is called only if something has changed, if a module has been enabled or disabled. (That function is what calls menu_rebuild() which is what rebuilds the menus.)
More like this
- Passing an argument to a Drupal form through hook_menu and use of drupal_get_form
- Rebuild menu cache to force recognition of menus added while developing a module
- On the trail of the mysql binary log-clogger: menu_rebuild?
- Adding non-menu things to primary links menu items with Drupal 7's page alter hook
- Capturing Menu Block configuration in code with hook_menu_block_blocks()


Comments
Post new comment