- 🇨🇦Canada mgifford Ottawa, Ontario
I am in favour of adding this patch. This does very much seem to be a best practice we should be adopting.
https://www.accessibility-developer-guide.com/examples/sensible-aria-usa...
https://design-system.w3.org/components/pagination.html
https://tink.uk/using-the-aria-current-attribute/
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attribut...
https://getbootstrap.com/docs/4.0/components/breadcrumb/
https://a11y-guidelines.orange.com/en/articles/using-aria-current-attrib... - 🇨🇦Canada mgifford Ottawa, Ontario
Removing the accessibility maintainer review.
- Status changed to Needs review
almost 2 years ago 4:45pm 24 January 2023 - 🇺🇸United States smustgrave
Oh man horrible review on my part.
Rerolled for D10 addressing the other themes that were left out.
I don't think the olivero one is needed but wanted some feedback.
Also if this is the correct approach are we going to need tests per theme?
- 🇫🇷France duaelfr Montpellier, France
#63 asked this processing to be removed from
template_preprocess_pager()
as it would be a BC break. BC Layer has been removed in #3087517: Remove BC layer for Pager service → so I suppose we could now just make this in this function and that would apply on all themes that didn't remove theitem.attributes
output from their own templates (including contrib themes).What do you think about it?
- Status changed to Needs work
almost 2 years ago 4:20pm 14 February 2023 - 🇺🇸United States smustgrave
I think that would be the best solution.
Also thing we should add simple test assertion that the attribute appears.
- Status changed to Needs review
over 1 year ago 12:04am 8 April 2023 The last submitted patch, 96: 2952488-96-tests-only.patch, failed testing. View results →
- 🇮🇳India pradipmodh13 Ahmedabad
Applied patch #96 applied successfully in drupal-10.1.x-dev.
We can move this ticket to RTBC.
Thanks for the patch.
Attached screenshot. - Status changed to Needs work
over 1 year ago 12:12am 6 May 2023 - 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
Looking good, one obvervation and a change required for the test changes in my book
-
+++ b/core/includes/theme.inc @@ -1828,6 +1828,7 @@ function template_preprocess_pager(&$variables) { $items['pages'][$i]['attributes'] = new Attribute(); if ($i == $pager_current) { $variables['current'] = $i; + $items['pages'][$i]['attributes']['aria-current'] = t('Current page');
At this point $item['pages'][$i]['attributes'] is an Attribute object, so in theory we could use ->setAttribute here instead of ArrayAccess, but not sure it matters that much
-
+++ b/core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php @@ -39,6 +39,7 @@ protected function setUp(): void { @@ -51,16 +52,17 @@ public function testQuantityNotSet() { @@ -51,16 +52,17 @@ public function testQuantityNotSet() { require_once $this->root . '/core/includes/theme.inc'; $variables = [ 'pager' => [ - '#element' => '', + '#element' => '2', '#parameters' => [], - '#quantity' => '', + '#quantity' => '2',
The test method is named testQuantityNotSet but now the quantity is set.
Is there another test method we can use here instead of modifying the intent of this test? Or should we just add another method? This is a unit test so it should be cheap
-
- 🇨🇦Canada mgifford Ottawa, Ontario
- Status changed to Needs review
over 1 year ago 5:41pm 8 June 2023 - last update
over 1 year ago Patch Failed to Apply - Status changed to Needs work
over 1 year ago 8:07pm 8 June 2023 The Needs Review Queue Bot → tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide → to find step-by-step guides for working with issues.
- last update
over 1 year ago Patch Failed to Apply - Status changed to Needs review
over 1 year ago 9:52pm 14 June 2023 - last update
over 1 year ago 29,449 pass - 🇫🇷France andypost
+++ b/core/includes/theme.inc @@ -1827,6 +1827,7 @@ function template_preprocess_pager(&$variables) { + $items['pages'][$i]['attributes']->setAttribute('aria-current', t('Current page'));
it could use
new TranslatableMarkup
instead oft()
- Status changed to Needs work
over 1 year ago 10:03pm 14 June 2023 - 🇫🇷France andypost
+++ b/core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php @@ -39,6 +39,7 @@ protected function setUp(): void { + $container->set('string_translation', $this->getStringTranslationStub()); @@ -63,4 +64,26 @@ public function testQuantityNotSet() { + $this->assertEquals('Current page', $variables['items']['pages']['2']['attributes']->offsetGet('aria-current')->__toString());
Please use
getUntranslatedString()
instead of testing string translation - Status changed to Needs review
over 1 year ago 12:08am 15 June 2023 - last update
over 1 year ago 29,449 pass - last update
over 1 year ago 29,449 pass - Status changed to RTBC
over 1 year ago 1:17am 15 June 2023 - 🇺🇸United States smustgrave
Ah thanks! I'll have to note that.
Since this was a small patch and the change touched each line think I'm good to mark it also.
- last update
over 1 year ago 29,487 pass 33:10 32:00 Running- last update
over 1 year ago 29,506 pass - last update
over 1 year ago 29,552 pass - last update
over 1 year ago 29,554 pass - last update
over 1 year ago 29,560 pass - last update
over 1 year ago 29,564 pass - last update
over 1 year ago 29,572 pass - last update
over 1 year ago 29,802 pass - last update
over 1 year ago 29,802 pass - last update
over 1 year ago 29,803 pass - last update
over 1 year ago 29,803 pass - last update
over 1 year ago 29,808 pass - last update
over 1 year ago 29,812 pass - last update
over 1 year ago 29,816 pass - last update
over 1 year ago 29,816 pass - last update
over 1 year ago 29,823 pass - last update
over 1 year ago 29,841 pass - last update
over 1 year ago 29,879 pass - last update
over 1 year ago 29,882 pass -
longwave →
committed 2f060c96 on 10.1.x
Issue #2952488 by smustgrave, pminf, dcgoodwin, andypost, pau1_m, sim_1...
-
longwave →
committed 2f060c96 on 10.1.x
- 🇬🇧United Kingdom longwave UK
Backported to 10.1.x as an accessibility bug fix.
Committed and pushed 38e908395d to 11.x and 2f060c96e5 to 10.1.x. Thanks!
Fixed on commit:
--- a/core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php +++ b/core/modules/system/tests/src/Unit/Pager/PreprocessPagerTest.php @@ -40,7 +40,7 @@ protected function setUp(): void { $container = new ContainerBuilder(); $container->set('pager.manager', $pager_manager); $container->set('url_generator', $url_generator); - // The template_preprocess_pager() rendering translatable attribute values. + // template_preprocess_pager() renders translatable attribute values. $container->set('string_translation', $this->getStringTranslationStub()); \Drupal::setContainer($container); }
-
longwave →
committed 38e90839 on 11.x
Issue #2952488 by smustgrave, pminf, dcgoodwin, andypost, pau1_m, sim_1...
-
longwave →
committed 38e90839 on 11.x
- Status changed to Fixed
over 1 year ago 1:36pm 27 July 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
over 1 year ago 8:01pm 31 August 2023 - 🇺🇸United States neclimdul Houston, TX
Looks like the value used for this attribute is incorrect. Filed a follow up
https://www.drupal.org/project/drupal/issues/3384679 🐛 aria-current is giving an invalid value Fixed