function menu_rebuild


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 menu_rebuild()
cle7 menu_rebuild()
elmsmedia7 menu_rebuild()
icor7 menu_rebuild()
meedjum_blog7 menu_rebuild()
mooc7 menu_rebuild()

Populates the database tables used by various menu functions.

This function will clear and populate the {menu_router} table, add entries to {menu_links} for new router items, and 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.

Return value

TRUE if the menu was rebuilt, FALSE if another thread was rebuilding in parallel and the current thread just waited for completion.

Related topics

38 calls to menu_rebuild()
addanother_update_7002 in sites/all/modules/ulmus/addanother/addanother.install
Clears site-wide menu cache as our callback and access arguments have changed.
admin_devel_form_admin_menu_theme_settings_alter_rebuild_submit in sites/all/modules/ulmus/admin_menu/admin_devel/admin_devel.module
Form submit handler to wipe and rebuild all 'module' = 'system' menu links.
admin_menu_toggle_modules in sites/all/modules/ulmus/admin_menu/
Menu callback; Enable/disable developer modules.
date_tools_wizard_form_submit in sites/all/modules/ulmus/date/date_tools/
devel_menu_rebuild in sites/all/modules/ulmus/devel/
Menu callback; clear the database, resetting the menu to factory defaults.

... See full list

2 string references to 'menu_rebuild'
advagg_enable in sites/all/modules/ulmus/advagg/advagg.install
Implements hook_enable().
advagg_mod_admin_settings_form_submit in sites/all/modules/ulmus/advagg/advagg_mod/
Clear out the advagg cache bin when the save configuration button is pressed.


includes/, line 2709
API for the Drupal menu system.


function menu_rebuild() {
  if (!lock_acquire('menu_rebuild')) {
    // Wait for another request that is already doing this work.
    // We choose to block here since otherwise the router item may not
    // be available in menu_execute_active_handler() resulting in a 404.
    return FALSE;

  $transaction = db_transaction();

  try {
    list($menu, $masks) = menu_router_build();
    _menu_router_save($menu, $masks);
    // Clear the menu, page and block caches.

    if (defined('MAINTENANCE_MODE')) {
      variable_set('menu_rebuild_needed', TRUE);
    else {
  catch (Exception $e) {
    watchdog_exception('menu', $e);

  return TRUE;