diff --cc core/modules/book/book.module index 94c75b0,bb2d6d5..0000000 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@@ -658,7 -691,7 +678,7 @@@ function template_preprocess_book_navig $build = array(); if ($prev = book_prev($book_link)) { -- $prev_href = url($prev['href']); ++ $prev_href = url($prev['link_path']); $build['#attached']['drupal_add_html_head_link'][][] = array( 'rel' => 'prev', 'href' => $prev_href, @@@ -678,7 -711,7 +698,7 @@@ } if ($next = book_next($book_link)) { -- $next_href = url($next['href']); ++ $next_href = url($next['link_path']); $build['#attached']['drupal_add_html_head_link'][][] = array( 'rel' => 'next', 'href' => $next_href, diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 444cb9b..3a55eba 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -892,6 +892,10 @@ function _menu_link_translate(&$item) { if (!isset($item['access'])) { $item['access'] = \Drupal::getContainer()->get('access_manager')->checkNamedRoute($item['route_name'], $item['route_parameters'], \Drupal::currentUser()); } + // For performance, don't localize a link the user can't access. + if ($item['access']) { + _menu_item_localize($item, array(), TRUE); + } } // Allow other customizations - e.g. adding a page-specific query string to the diff --git a/core/modules/book/lib/Drupal/book/BookManager.php b/core/modules/book/lib/Drupal/book/BookManager.php index b2cbd97..01ae283 100644 --- a/core/modules/book/lib/Drupal/book/BookManager.php +++ b/core/modules/book/lib/Drupal/book/BookManager.php @@ -660,7 +660,7 @@ public function bookTreeOutput(array $tree) { $element['#theme'] = 'menu_link__' . strtr($data['link']['menu_name'], '-', '_'); $element['#attributes']['class'] = $class; $element['#title'] = $data['link']['title']; - $element['#href'] = $data['link']['href']; + $element['#href'] = $data['link']['link_path']; $element['#localized_options'] = !empty($data['link']['localized_options']) ? $data['link']['localized_options'] : array(); $element['#below'] = $data['below'] ? $this->bookTreeOutput($data['below']) : $data['below']; $element['#original_link'] = $data['link']; diff --git a/core/modules/book/lib/Drupal/book/Tests/BookTest.php b/core/modules/book/lib/Drupal/book/Tests/BookTest.php index 93c5c78..ab33373 100644 --- a/core/modules/book/lib/Drupal/book/Tests/BookTest.php +++ b/core/modules/book/lib/Drupal/book/Tests/BookTest.php @@ -167,6 +167,7 @@ function checkBookNode(EntityInterface $node, $nodes, $previous = FALSE, $up = F // Check outline structure. if ($nodes !== NULL) { + debug($this->generateOutlinePattern($nodes)); $this->assertPattern($this->generateOutlinePattern($nodes), format_string('Node @number outline confirmed.', array('@number' => $number))); } else { diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationContextualLinks.php b/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationContextualLinks.php index 0fac412..9d06ebd 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationContextualLinks.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Plugin/Derivative/ConfigTranslationContextualLinks.php @@ -58,7 +58,7 @@ public function getDerivativeDefinitions(array $base_plugin_definition) { continue; } - /** @var \Drupal\config_translation\ConfigMapperInterface $mapper */ + /** @type \Drupal\config_translation\ConfigMapperInterface $mapper */ $route_name = $mapper->getOverviewRouteName(); $this->derivatives[$route_name] = $base_plugin_definition; $this->derivatives[$route_name]['config_translation_plugin_id'] = $plugin_id; diff --git a/core/modules/user/user.module b/core/modules/user/user.module index d582943..9d8dfac 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -752,6 +752,13 @@ function user_menu() { 'type' => MENU_CALLBACK, ); + $items['user/logout'] = array( + 'title' => 'Log out', + 'route_name' => 'user.logout', + 'weight' => 10, + 'menu_name' => 'account', + ); + // User listing pages. $items['admin/people'] = array( 'title' => 'People',