Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
image.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Oct 2025 at 15:27 UTC
Updated:
12 Jul 2026 at 08:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
grimreaperComment #4
nicxvan commentedThis will need a change record at least.
While this is covered by bc policy https://www.drupal.org/about/core/policies/core-change-policies/frontend...
I think it could be disruptive so we should document it. One minor comment on the mr too.
Comment #5
smustgrave commentedDefinitely a CR. But the todo can it point to an issue too
Comment #6
grimreaperComment #7
grimreaperHello,
Thanks for your reviews and feedbacks.
Draft CR created: https://www.drupal.org/node/3554585
I removed the todos in favor of proper deprecation warnings.
Should I create a follow-up issue for the deprecated code removal in Core 12?
Comment #8
astonvictor commentedtested locally. seems there are no other places to update. Attached screenshot after applying the patch.
let's wait for other reviewers to double check.
Comment #9
smustgrave commentedcan we get a deprecation test please
Comment #10
grimreaperComment #11
grimreaper#3522087: set_attribute Twig filter doesn't work on responsive_image_formatter element did one part of the proposed changes here but only for responsive image.
Comment #12
grimreaperRebased and deprecation tests added.
Back to needs review.
Comment #13
smustgrave commentedSorry small tweak can we bump to 11.4 think it’s too late for 11.3
Rest looks good though
Comment #14
grimreaperSorry, maybe I have not understood the expression, but I don't see any more code review comments.
The MR and the issue target 11.x, so it will be "automatically" for 11.4 now.
No need to specify it? Or did I miss something?
Thanks again for the review.
Comment #15
smustgrave commentedI mean the deprecations
Comment #16
grimreaperOk, MR updated.
Comment #17
smustgrave commentedThanks! Feedback appears to be addressed
Comment #20
alexpottI've rebased the branch on top of main.
Comment #21
alexpottCommitted and pushed 85468ee47db to main and 54be7186870 to 11.x. Thanks!
Comment #25
alexpottWe can open a follow-up on main to remove the deprecation and #item_attributes.
Comment #26
grimreaperHello,
Thanks @alexpott for the merge!
I will do the follow up.
Should I also publish the CR?
Comment #27
grimreaperFollow up issue created #3571111: Remove item_attributes deprecations.
Comment #30
berdirFor the record, this did break for us on 11.4 because we had a preprocess hook that added something to the attributes of an image. Looking at https://search.tresbien.tech/search?q=%23item_attributes%20-r%3Adrupal&n..., I think at least lazy.module definitely is also affected by this. I identified 3 different cases that alter item attributes like that in our distribution,
I know we can change render arrays like that, still a pretty subtle change that isn't obvious if you don't have explicit test coverage or tests you can run on 11.x that trigger deprecations. And I'm not sure if changing template parameters is a render array change for the dozens of examples there that use #theme image_formatter (some use their own templates with their own item_attributes), so making it a D12 deprecation is maybe a bit tricky.
BC is hard, just also defining attributes woudn't help, which one do you then use, how do you figure out if item_attributes or attributes was altered?
@grimreaper: I suspect your ui_styles project might also be affected? https://git.drupalcode.org/project/ui_styles/-/blob/8.x-1.x/src/StylePlu..., the bit about THEME_WITH_ITEM_ATTRIBUTES isn't going to work anymore like that when it's different on different core minor versions?
Comment #31
grimreaperThanks @berdir for the comment.
I forgot to update ui_styles because initially I expected #3517033: Add a style utility API to be merged "quickly" so handling the change directly in #3517009: POC: Core styles API.
I have created a follow up issue on ui_styles to handle that in the meantime, #3600682: [Core 11.4] Handle item_attributes removal.
Comment #32
mattsqd commentedIs there any chance we can have this behave more like this?
Something like this instead:
Otherwise, anything set in
$variables['attributes'](like lazy = loading) will stop any modifications in$variables['item_attributes']from applying.Comment #33
grimreaperHi,
Good catch, please create a follow-up issue.
You can propose an MR if you want.
Comment #34
grimreaperI have created the follow up issue #3610352: Better handling of item_attributes deprecation