diff --git a/core/includes/menu.inc b/core/includes/menu.inc
index 6abab20..0511ad4 100644
--- a/core/includes/menu.inc
+++ b/core/includes/menu.inc
@@ -2732,6 +2732,9 @@ function menu_router_rebuild() {
  *   (optional) Save the new router to the database. Defaults to FALSE.
  */
 function menu_router_build($save = FALSE) {
+  // Ensure that all configuration used to build the menu items are loaded
+  // without overrides.
+  config_context_enter('config.context.free');
   // We need to manually call each module so that we can know which module
   // a given item came from.
   $callbacks = array();
@@ -2746,6 +2749,8 @@ function menu_router_build($save = FALSE) {
   }
   // Alter the menu as defined in modules, keys are like user/%user.
   drupal_alter('menu', $callbacks);
+  // Return to the original context before menu building.
+  config_context_leave();
   foreach ($callbacks as $path => $router_item) {
     // If the menu item is a default local task and incorrectly references a
     // route, remove it.
