Skip to content
Snippets Groups Projects
Verified Commit d6a990b8 authored by Lauri Timmanee's avatar Lauri Timmanee
Browse files

Issue #3384679 by Gauravvvv, kostyashupenko, neclimdul, PickyOrder, mgifford:...

Issue #3384679 by Gauravvvv, kostyashupenko, neclimdul, PickyOrder, mgifford: aria-current is giving an invalid value
parent 1e830175
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,6 @@
*/
use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Url;
use Drupal\Component\Serialization\Json;
use Drupal\Component\Utility\Crypt;
......@@ -1837,7 +1836,7 @@ function template_preprocess_pager(&$variables) {
$items['pages'][$i]['attributes'] = new Attribute();
if ($i == $pager_current) {
$variables['current'] = $i;
$items['pages'][$i]['attributes']->setAttribute('aria-current', new TranslatableMarkup('Current page'));
$items['pages'][$i]['attributes']->setAttribute('aria-current', 'page');
}
}
// Add an ellipsis if there are further next pages.
......
......@@ -88,7 +88,7 @@ public function testQuantitySet() {
/** @var \Drupal\Core\Template\AttributeString $attribute */
$attribute = $variables['items']['pages']['2']['attributes']->offsetGet('aria-current');
$this->assertInstanceOf(AttributeString::class, $attribute);
$this->assertEquals('Current page', $attribute->value());
$this->assertEquals('page', $attribute->value());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment