diff --git a/core/lib/Drupal/Core/Routing/Enhancer/AuthenticationEnhancer.php b/core/lib/Drupal/Core/Routing/Enhancer/AuthenticationEnhancer.php index c2165fa..a68d83b 100644 --- a/core/lib/Drupal/Core/Routing/Enhancer/AuthenticationEnhancer.php +++ b/core/lib/Drupal/Core/Routing/Enhancer/AuthenticationEnhancer.php @@ -51,7 +51,13 @@ public function enhance(array $defaults, Request $request) { // If the request was authenticated with a non-permitted provider, // force the user back to anonymous. if (!in_array($auth_provider_triggered, $auth_providers)) { - $request->attributes->set('_account', drupal_anonymous_user()); + $anonymous_user = drupal_anonymous_user(); + $request->attributes->set('_account', $anonymous_user); + + // The global $user object is included for backward compatibility only + // and should be considered deprecated. + // @todo Remove this line once global $user is no longer used. + $GLOBALS['user'] = $anonymous_user; } } return $defaults; diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php index 0a94658..d1159cb 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Menu/MenuRouterTest.php @@ -137,15 +137,6 @@ function testThemeCallbackInheritance() { } /** - * Test that 'page callback', 'file' and 'file path' keys are properly - * inherited from parent menu paths. - */ - function testFileInheritance() { - $this->drupalGet('admin/config/development/file-inheritance'); - $this->assertText('File inheritance test description', 'File inheritance works.'); - } - - /** * Test path containing "exotic" characters. */ function testExoticPath() { diff --git a/core/modules/system/tests/modules/menu_test/menu_test.module b/core/modules/system/tests/modules/menu_test/menu_test.module index 030dac1..5315f00 100644 --- a/core/modules/system/tests/modules/menu_test/menu_test.module +++ b/core/modules/system/tests/modules/menu_test/menu_test.module @@ -294,13 +294,6 @@ function menu_test_menu() { 'access arguments' => array('access content'), ); - $items['admin/config/development/file-inheritance/inherit'] = array( - 'title' => 'Inherit', - 'description' => 'File inheritance test description', - 'page callback' => 'menu_test_callback', - 'access arguments' => array('access content'), - ); - // Test the access key. $items['menu-title-test/case1'] = array( 'title' => 'Example title - Case 1',