diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTests.php b/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTests.php
index 865878a..622b49e 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTests.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserAccountLinksTests.php
@@ -19,7 +19,7 @@ class UserAccountLinksTests extends WebTestBase {
    *
    * @var array
    */
-  public static $modules = array('menu', 'block');
+  public static $modules = array('menu', 'block', 'test_page_test');
 
   public static function getInfo() {
     return array(
@@ -29,6 +29,12 @@ public static function getInfo() {
     );
   }
 
+  public function setUp() {
+    parent::setUp();
+    // Make test-page default.
+    \Drupal::config('system.site')->set('page.front', 'test-page')->save();
+  }
+
   /**
    * Tests the secondary menu.
    */
@@ -61,7 +67,9 @@ function testSecondaryMenu() {
     $this->drupalGet('<front>');
 
     // For a logged-out user, expect no secondary links.
-    $element = $this->xpath('//ul[@id=:menu_id]', array(':menu_id' => 'secondary-menu'));
+    $element = $this->xpath('//ul/li/a[text()=:text]', array(
+    ':text' => 'User account',
+    ));
     $this->assertEqual(count($element), 0, 'No secondary-menu for logged-out users.');
   }
 
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index f8a4fb8..33d73bb 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -894,14 +894,12 @@ function user_menu_breadcrumb_alter(&$active_trail, $item) {
 }
 
 /**
- * Implements hook_menu_link_load().
+ * Implements hook_translated_menu_link_alter().
  */
-function user_menu_link_load($menu_links) {
+function user_translated_menu_link_alter(&$link) {
   // Hide the "User account" link for anonymous users.
-  foreach ($menu_links as $link) {
-    if ($link['link_path'] == 'user' && $link['module'] == 'system' && !$GLOBALS['user']->id()) {
-      $link['hidden'] = 1;
-    }
+  if ($link['link_path'] == 'user' && $link['module'] == 'system' && !$GLOBALS['user']->id()) {
+    $link['hidden'] = 1;
   }
 }
 
