diff --git a/core/modules/system/src/Controller/SystemController.php b/core/modules/system/src/Controller/SystemController.php index 40ca2f6..90c260c 100644 --- a/core/modules/system/src/Controller/SystemController.php +++ b/core/modules/system/src/Controller/SystemController.php @@ -329,7 +329,7 @@ public function themesPage() { } /** - * #post_render_cache callback; sets the "active" class on relevant links. + * #post_render_cache callback; sets the "is-active" class on relevant links. * * This is a PHP implementation of the drupal.active-link JavaScript library. * @@ -405,7 +405,7 @@ public static function setLinkActiveClass(array $element, array $context) { // Ensure we don't set the "active" class twice on the same element. $class = $node->getAttribute('class'); - $add_active = !in_array('active', explode(' ', $class)); + $add_active = !in_array('is-active', explode(' ', $class)); // The language of an active link is equal to the current language. if ($add_active && $context['language']) { @@ -429,7 +429,7 @@ public static function setLinkActiveClass(array $element, array $context) { } // Only if the path, the language and the query match, we set the - // "active" class. + // "is-active" class. if ($add_active) { if (strlen($class) > 0) { $class .= ' '; diff --git a/core/modules/system/tests/src/Unit/Controller/SystemControllerTest.php b/core/modules/system/tests/src/Unit/Controller/SystemControllerTest.php index 2b8cbe3..e5346e7 100644 --- a/core/modules/system/tests/src/Unit/Controller/SystemControllerTest.php +++ b/core/modules/system/tests/src/Unit/Controller/SystemControllerTest.php @@ -25,10 +25,10 @@ class SystemControllerTest extends UnitTestCase { * @see \Drupal\system\Controller\SystemController::setLinkActiveClass() */ public function providerTestSetLinkActiveClass() { - // Define all the variations that *don't* affect whether or not an "active" - // class is set, but that should remain unchanged: + // Define all the variations that *don't* affect whether or not an + // "is-active" class is set, but that should remain unchanged: // - surrounding HTML - // - tags for which to test the setting of the "active" class + // - tags for which to test the setting of the "is-active" class // - content of said tags $edge_case_html5 = '