diff --git a/core/includes/menu.inc b/core/includes/menu.inc index 96e2f9d..0ca3b65 100644 --- a/core/includes/menu.inc +++ b/core/includes/menu.inc @@ -418,6 +418,7 @@ function template_preprocess_menu_tree(&$variables) { 'attributes' => array(), ); // @todo Remove backwards compatibility for $heading['class']. + // https://www.drupal.org/node/2310341 if (isset($heading['class'])) { $heading['attributes']['class'] = $heading['class']; } diff --git a/core/lib/Drupal/Core/Utility/LinkGenerator.php b/core/lib/Drupal/Core/Utility/LinkGenerator.php index 4912a05..54a2635 100644 --- a/core/lib/Drupal/Core/Utility/LinkGenerator.php +++ b/core/lib/Drupal/Core/Utility/LinkGenerator.php @@ -99,7 +99,9 @@ public function generateFromUrl($text, Url $url) { // drupal.active-link library know the path in a standardized manner. if (!isset($variables['options']['attributes']['data-drupal-link-system-path'])) { // @todo System path is deprecated - use the route name and parameters. - $variables['options']['attributes']['data-drupal-link-system-path'] = $url->getInternalPath(); + $system_path = $url->getInternalPath(); + // Special case for the front page. + $variables['options']['attributes']['data-drupal-link-system-path'] = $system_path != '' ?: ''; } } diff --git a/core/misc/active-link.js b/core/misc/active-link.js index b8edfe3..5bd12eb 100644 --- a/core/misc/active-link.js +++ b/core/misc/active-link.js @@ -28,9 +28,9 @@ var originalSelectors = ['[data-drupal-link-system-path="' + path.currentPath + '"]']; var selectors; - // If this is the front page, we have to check for an empty path as well. + // If this is the front page, we have to check for the path as well. if (path.isFront) { - originalSelectors.push('[data-drupal-link-system-path=""]'); + originalSelectors.push('[data-drupal-link-system-path=""]'); } // Add language filtering. diff --git a/core/modules/menu_ui/src/Plugin/Menu/LocalAction/MenuLinkAdd.php b/core/modules/menu_ui/src/Plugin/Menu/LocalAction/MenuLinkAdd.php index b0238df..9fee161 100644 --- a/core/modules/menu_ui/src/Plugin/Menu/LocalAction/MenuLinkAdd.php +++ b/core/modules/menu_ui/src/Plugin/Menu/LocalAction/MenuLinkAdd.php @@ -28,8 +28,8 @@ public function getOptions(Request $request) { if ($request->attributes->has('_raw_variables')) { $raw_variables = $request->attributes->get('_raw_variables')->all(); } - // @todo use RouteMatch instead of Request - // https://www.drupal.org/node/2294157 + // @todo Use RouteMatch instead of Request. + // https://www.drupal.org/node/2294157 $options['query']['destination'] = \Drupal::urlGenerator()->generateFromRoute($route_name, $raw_variables); } return $options; diff --git a/core/modules/system/src/Controller/SystemController.php b/core/modules/system/src/Controller/SystemController.php index 8d5f2a7..c811e85 100644 --- a/core/modules/system/src/Controller/SystemController.php +++ b/core/modules/system/src/Controller/SystemController.php @@ -346,12 +346,12 @@ public function themesPage() { */ public static function setLinkActiveClass(array $element, array $context) { $search_key_current_path = 'data-drupal-link-system-path="' . $context['path'] . '"'; - $search_key_front = 'data-drupal-link-system-path'; + $search_key_front = 'data-drupal-link-system-path="<front>"'; // An active link's path is equal to the current path, so search the HTML // for an attribute with that value. $offset = 0; - while ((strpos($element['#markup'], $search_key_current_path, $offset) !== FALSE || ($context['front'] && strpos($element['#markup'], $search_key_front, $offset) !== FALSE))) { + while ((strpos($element['#markup'], 'data-drupal-link-system-path="' . $context['path'] . '"', $offset) !== FALSE || ($context['front'] && strpos($element['#markup'], 'data-drupal-link-system-path="<front>"', $offset) !== FALSE))) { $pos_current_path = strpos($element['#markup'], $search_key_current_path, $offset); $pos_front = strpos($element['#markup'], $search_key_front, $offset); diff --git a/core/modules/system/src/Tests/Menu/LinksTest.php b/core/modules/system/src/Tests/Menu/LinksTest.php index 3cb51e1..cbb9c8f 100644 --- a/core/modules/system/src/Tests/Menu/LinksTest.php +++ b/core/modules/system/src/Tests/Menu/LinksTest.php @@ -16,7 +16,8 @@ * * @group Menu * - * @todo: move this under menu_link_content module. + * @todo Move this under menu_link_content module. + * https://www.drupal.org/node/2310353 */ class LinksTest extends WebTestBase { @@ -172,7 +173,7 @@ function testMenuLinkReparenting($module = 'menu_test') { ); $this->assertMenuLinkParents($links, $expected_hierarchy); - // @todo - figure out what makes sense to test in terms of automatic + // @todo Figure out what makes sense to test in terms of automatic // re-parenting. https://www.drupal.org/node/2309531 } diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module index cae2567..93b37be 100644 --- a/core/modules/toolbar/toolbar.module +++ b/core/modules/toolbar/toolbar.module @@ -461,7 +461,8 @@ function toolbar_menu_navigation_links(array $tree) { $element->options['attributes']['id'] = 'toolbar-link-' . $id; $element->options['attributes']['class'][] = 'toolbar-icon'; - // @todo Change to use the plugin ID as class as titles might change. + // @todo Change to use the plugin ID as class since titles might change. + // https://www.drupal.org/node/2310365 $element->options['attributes']['class'][] = 'toolbar-icon-' . strtolower(str_replace(' ', '-', $definition['title'])); $element->options['attributes']['title'] = String::checkPlain($link->getDescription()); }