Problem/Motivation
Drupal 11.4 deprecated the #item_attributes property for a number of theme elements. The deprecation-handling code prefers the newer #attributes property, setting up a situation where code using the older #item_attributes property may break, even though it is nominally still supported in Drupal 11.x.
Some of those breaks do seem to occur for Media Helper, which constructs image arrays using #item_attributes.
Steps to reproduce
Run media_helper's PHPUnit tests. Two fail because elements cannot be found by ID - the custom attribute did not make it into rendered output.
Proposed resolution
Since this is an outright break, the module should use #attributes when running on Drupal >= 11.4.
API changes
media_helper follows Drupal Core's lead in immediately adopting #attributes for image theme elements in Drupal 11.4+
Issue fork media_helper-3606366
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
bvoynickComment #6
bvoynick