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/api.elmsln.org/includes/bootstrap.inc).
cis7 menu.inc menu_rebuild()
cle7 menu.inc menu_rebuild()
elmsmedia7 menu.inc menu_rebuild()
icor7 menu.inc menu_rebuild()
meedjum_blog7 menu.inc menu_rebuild()
mooc7 menu.inc 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/admin_menu.inc
Menu callback; Enable/disable developer modules.
date_tools_wizard_form_submit in sites/all/modules/ulmus/date/date_tools/date_tools.wizard.inc
@todo.
devel_menu_rebuild in sites/all/modules/ulmus/devel/devel.pages.inc
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/advagg_mod.admin.inc
Clear out the advagg cache bin when the save configuration button is pressed.

File

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

Code

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.
    lock_wait('menu_rebuild');
    return FALSE;
  }

  $transaction = db_transaction();

  try {
    list($menu, $masks) = menu_router_build();
    _menu_router_save($menu, $masks);
    _menu_navigation_links_rebuild($menu);
    // 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');
    }
  }
  catch (Exception $e) {
    $transaction->rollback();
    watchdog_exception('menu', $e);
  }

  lock_release('menu_rebuild');
  return TRUE;
}