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
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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.
+1 −1
Original line number Diff line number Diff line
@@ -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());
  }

}