diff --git a/core/modules/views/tests/src/Functional/Plugin/MiniPagerTest.php b/core/modules/views/tests/src/Functional/Plugin/MiniPagerTest.php index 910fb649de98cbe6188ff25986ac833090a45d6f..b53099554d634b68df7db1a2bc821423eba881e7 100644 --- a/core/modules/views/tests/src/Functional/Plugin/MiniPagerTest.php +++ b/core/modules/views/tests/src/Functional/Plugin/MiniPagerTest.php @@ -165,8 +165,7 @@ public function testPagerHeadingLevel() { $view->display_handler->setOption('pager', $pager); $view->save(); - // Stark is handled below. - // Stable9 will be addressed in https://www.drupal.org/project/drupal/issues/3333418 + // Stark and Stable9 are handled below. $themes = ['olivero', 'claro', 'starterkit_theme']; $this->container->get('theme_installer')->install($themes); @@ -176,11 +175,14 @@ public function testPagerHeadingLevel() { $this->assertEquals('h3', $this->assertSession()->elementExists('css', ".pager .visually-hidden")->getTagName()); } - // The core views template uses a different class structure than core themes. - $this->container->get('theme_installer')->install(['stark']); - $this->config('system.theme')->set('default', 'stark')->save(); - $this->drupalGet('test_mini_pager'); - $this->assertEquals('h3', $this->assertSession()->elementExists('css', "#pagination-heading")->getTagName()); + // The core views template and Stable9 use a different class structure than other core themes. + $themes = ['stark', 'stable9']; + $this->container->get('theme_installer')->install($themes); + foreach ($themes as $theme) { + $this->config('system.theme')->set('default', $theme)->save(); + $this->drupalGet('test_mini_pager'); + $this->assertEquals('h3', $this->assertSession()->elementExists('css', "#pagination-heading")->getTagName()); + } } } diff --git a/core/modules/views/tests/src/Functional/Plugin/PagerTest.php b/core/modules/views/tests/src/Functional/Plugin/PagerTest.php index b873aca21e401d91724060bd636cbea66830a3c8..a9339e58291deb229e70033df2ab935cab89e724 100644 --- a/core/modules/views/tests/src/Functional/Plugin/PagerTest.php +++ b/core/modules/views/tests/src/Functional/Plugin/PagerTest.php @@ -400,8 +400,7 @@ public function testPagerHeadingLevel() { $view->display_handler->setOption('pager', $pager); $view->save(); - // Stable9 will be addressed in https://www.drupal.org/project/drupal/issues/3333418 - $themes = ['stark', 'olivero', 'claro', 'starterkit_theme']; + $themes = ['stark', 'olivero', 'claro', 'starterkit_theme', 'stable9']; $this->container->get('theme_installer')->install($themes); foreach ($themes as $theme) { diff --git a/core/themes/stable9/templates/navigation/pager.html.twig b/core/themes/stable9/templates/navigation/pager.html.twig index 6f863faaf91206bd7e563c9dde65327b4645ccfa..e28acb5e2bf6404e1a2033b754f33e850f5780c3 100644 --- a/core/themes/stable9/templates/navigation/pager.html.twig +++ b/core/themes/stable9/templates/navigation/pager.html.twig @@ -5,6 +5,7 @@ * * Available variables: * - heading_id: Pagination heading ID. + * - pagination_heading_level: The heading level to use for the pager. * - items: List of pager items. * The list is keyed by the following elements: * - first: Item for the first page; not present on the first page of results. @@ -32,7 +33,7 @@ #} {% if items %} <nav class="pager" role="navigation" aria-labelledby="{{ heading_id }}"> - <h4 id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</h4> + <{{ pagination_heading_level }} id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</{{ pagination_heading_level }}> <ul class="pager__items js-pager__items"> {# Print first item if we are not on the first page. #} {% if items.first %} diff --git a/core/themes/stable9/templates/views/views-mini-pager.html.twig b/core/themes/stable9/templates/views/views-mini-pager.html.twig index 24f8f7aa994eb2067f0ec5f6550e13eed6634f6b..86199b9637d3fceb6eb554ad995243acd57e6f4f 100644 --- a/core/themes/stable9/templates/views/views-mini-pager.html.twig +++ b/core/themes/stable9/templates/views/views-mini-pager.html.twig @@ -5,6 +5,7 @@ * * Available variables: * - heading_id: Pagination heading ID. + * - pagination_heading_level: The heading level to use for the pager. * - items: List of pager items. * * @see template_preprocess_views_mini_pager() @@ -12,7 +13,7 @@ #} {% if items.previous or items.next %} <nav role="navigation" aria-labelledby="{{ heading_id }}"> - <h4 id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</h4> + <{{ pagination_heading_level }} id="{{ heading_id }}" class="visually-hidden">{{ 'Pagination'|t }}</{{ pagination_heading_level }}> <ul class="js-pager__items"> {% if items.previous %} <li>