New Aria Content for Current Page on View Pager Causes Error

Created on 23 August 2023, over 1 year ago
Updated 25 August 2023, over 1 year ago

Problem/Motivation

TypeError: Drupal\Core\Template\TwigExtension::createAttribute(): Argument #1 ($attributes) must be of type array, Drupal\Core\Template\Attribute given, called in /var/www/html/web/sites/default/files/php/twig/64e4bcc5789d7_pagination-item.twig_VbIrisxNk-AV0cUBsLpFJAU_x/TN0L4rZx8_UFLexB79WCqZDd_baNIfQD8CEyOYxwINo.php on line 52 in Drupal\Core\Template\TwigExtension->createAttribute() (line 615 of core/lib/Drupal/Core/Template/TwigExtension.php).

Steps to reproduce

When rendering a custom view with a pager, the php file created from twig uses the _twig_default_filter to test the link value for empty. There is now an aria-content value attribute identifying the current page added in Drupal 10.1.2 to the theme.inc file. The return value (an Attributes Object) is returned to method createAttribute which expects the value to be an array. This causes the error.

  • createAttribute line 615 in web/core/lib/Drupal/Core/Template/TwigExtension.php
  • _twig_default_filter line 796 in vendor/twig/twig/src/Extension
  • CoreExtension.php line 1831 in core/includes/theme.inc

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Closed: works as designed

Version

10.1

Component
Theme 

Last updated 14 minutes ago

Created by

🇺🇸United States pelicani

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024