Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
image.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
30 Jun 2025 at 20:48 UTC
Updated:
14 Oct 2025 at 10:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
berdirReducing scope to image module. there are several, in different include files, so that seems enough on its own.
Not 100% sure on BC for the functions in the include files, there might be some edge cases where that might fail anyway, but kept the pattern for now and moved them to .module.
Used the new closure pattern for the injected logger service, makes it a tiny bit more complicated, but seems like a good compromise for the typical logger-used-in-rare-case scenario and we'd need an Attribute anyway for autowiring.
Comment #4
berdirThe performance test fail confused me, I thought we somehow no longer load a config or I had the wrong config name. But that's not it, it's the opposite. Because this is now injected here, it's loaded already on the initial user/login request that warms up bootstrap caches and it's cached afterwards.
I opened #3533322: Do not fetch default image toolkit ID in ImageFactory::__construct() for this.
Comment #5
berdirUpdated the comment references in templates that I forgot before. I'd prefer doing the issue in #4 first to avoid the misleading performance test change here.
Comment #6
smustgrave commentedAre we doing CRs for all the twig templates that would have to be updated on contrib modules?
Comment #7
nicxvan commentedWhat twig templates would need to be updated?
Comment #8
smustgrave commentedThis one has 5 twig template it appears to be updating the @see for.
Comment #9
nicxvan commentedWe've not done CRs on other issues like this for that, I don't think this really warrants one since it's just a comment.
Comment #10
berdirInitially I considered to drop this pattern with the @see referencing the template/initial preprocess, but got some resistance on that from theme maintainers, so I gave up on that, at least in this scope. It's similar with the docs in twig templates in general, some of these templates have extensive docs that are copy pasted around and tend to get outdated. The default node.html.twig for example has 60 lines of comments and 20 lines of actual markup. And that whole thing exists 11 times in core. And it is at least partially outdated, there's a whole block on default classes, which in fact do not exist but are set within the twig template itself in some cases and not others. Many of us are probably using IDE's or editors that hide that by default and don't even notice it anymore. But I also don't have a great idea on what else we should do. It can be useful for people who are new to Drupal and theming I guess.
Comment #11
smustgrave commentedYea not sure what the best approach is. I know when I override a template I usually copy the whole thing, comments included for the next dev.
What if we had just a generic overall CR for themers to update their templates to use these classes?
Comment #12
berdirWe have a generic change record: https://www.drupal.org/node/3504125. but I don't see the point of telling people to update the @see. Nobody is going to do that, that's a lot of tedious work for no real gain. Yeah, in 5 years, if someone looks at a template they won't find that function anymore. But they can just look at the source template, that takes a few seconds, far less time than manually updating all templates.
Comment #13
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #14
berdirThe soft blocker is in, this can be rerolled and there shouldn't be any performance test changes anymore.
Comment #15
berdirRebased without the performance stuff
Comment #16
nicxvan commentedThis is ready now!
I confirmed template_preprocess_HOOK were all moved to image.module
There are only single _
Zebra shows only changes are file key, DI, t() and comments for cs
Confirmed deprecations are file and functions as expected
All initial preprocess align with the theme keys
Comment #17
quietone commentedI am going to ask the other committers about the change record on this.
I have updated credit.
Comment #18
quietone commentedI think it best to link to a change record instead of an issue. I talked to catch and we agreed to continue to use the existing CR but to update it to resolve the @todo at the bottom of it. This is the @todo. And I think it should just be just Drupal 12 as it looks like all the conversions will be completed by then.
Comment #19
catchI've updated the CR to include this line "Note that some procedural functions were converted in Drupal 11.2 and some in 11.3. " next to where we say we don't expect people to be interacting with them directly.
Also updated the removal version to Drupal 12 per #18 - we can always change our minds again later but there's not that many of these compared to hooks in general.
Comment #21
catchCommitted/pushed to 11.x, thanks!
Comment #24
berdirThat reminds me, the information when a BC layer is removed does currently not exist in a structured way in change records, that would be way more useful than the branch. Does someone know if an issue exists to add that? Especially now when not everything is being removed for the next major.
I think removing old template_preprocess functions in D12 is one thing, removing support for it might be pretty disruptive. On the other side, BC is built-in and just works (Drupal 11.2+ only looks for a template_ function if no explicit initial preprocess is specified), so it's pretty easy to do that, I recently updated token module accordingly. You don't need a LegacyHook attribute or anything, just leave the old function there and either call the new or just keep it as-is, depending on how much code there is. And it would also make it easier to also deprecate the file and includes keys in hook_theme for D12 (which aren't deprecated yet), because template_preprocess functions is really the only thing they are still used for. We an add an explicit deprecation in either the meta issue or a follow-up of it and finalize that there.
Updating metadata, this in image.module task not a feature.