Problem/Motivation

#3554447: Use #attributes instead of #item_attributes deprecated images' #item_attributes render array key in favor of #attributes. Image and responsive-image preprocessing implemented the deprecation differently. preprocessImageFormatter() only uses #item_attributes if #attributes is empty, otherwise completely throwing it away. preprocessResponsiveImageFormatter() appends #item_attributes if it's set to #attributes.

Proposed resolution

Update preprocessImageFormatter() to behave like preprocessResponsiveImageFormatter(), appending #item_attributes if it's set to #attributes.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3610352

Command icon 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

grimreaper created an issue. See original summary.

grimreaper’s picture

Version: 11.4.x-dev » 11.x-dev

grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Active » Needs review

Unrelated test failure.

smustgrave’s picture

Status: Needs review » Needs work

Can the MR point to main first. Assume it will have to land there first

Thanks

grimreaper’s picture

Status: Needs work » Needs review

It does not have to point to main because the deprecated code is already removed in main.

In #3571111: Remove item_attributes deprecations, remember ;)

smustgrave’s picture

Is that 2nd deprecation message now needed?

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Actually nvm this seems fine for 11.x

larowlan’s picture

Status: Reviewed & tested by the community » Needs review

Question on the MR - thanks

grimreaper’s picture

Assigned: Unassigned » grimreaper

Thanks for the review.

grimreaper’s picture

Assigned: grimreaper » larowlan

I replied in the MR.

Let's ensure there is an agreement before doing change.

dcam made their first commit to this issue’s fork.

dcam’s picture

Assigned: larowlan » Unassigned
Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

I reviewed @larowlan's question. I agree that the current behavior appending #item_attributes is correct. If it's decided that merging the arrays should be the correct behavior, then the issue must be re-scoped to do that for both the image and responsive-image preprocessors. Honestly, I'm not sure it's worth it to do that for deprecated behavior.

I didn't like the way that the issue summary was written. It took me too long to completely understand the nature of the requested change. So I updated the summary to better state what the nature of the problem is and what the proposed resolution is.