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
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 #2
grimreaperComment #4
grimreaperUnrelated test failure.
Comment #5
smustgrave commentedCan the MR point to main first. Assume it will have to land there first
Thanks
Comment #6
grimreaperIt does not have to point to main because the deprecated code is already removed in main.
In #3571111: Remove item_attributes deprecations, remember ;)
Comment #7
smustgrave commentedIs that 2nd deprecation message now needed?
Comment #8
smustgrave commentedActually nvm this seems fine for 11.x
Comment #9
larowlanQuestion on the MR - thanks
Comment #10
grimreaperThanks for the review.
Comment #11
grimreaperI replied in the MR.
Let's ensure there is an agreement before doing change.
Comment #13
dcam commentedI reviewed @larowlan's question. I agree that the current behavior appending
#item_attributesis 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.