Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
theme system
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
21 Sep 2025 at 09:23 UTC
Updated:
8 Oct 2025 at 15:29 UTC
Jump to comment: Most recent
Part of #3504381: [meta] Convert Template Preprocess hooks to OOP equivalent
Convert template_preprocess in the following modules:
* comment
* filter
* link
* layout_discovery
* media
* media_library
* navigation
* toolbar
* user
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
berdirComment #3
berdirComment #5
berdirComment #6
nicxvan commentedI think that is a real failure
Comment #7
mstrelan commentedThe test fails because its expecting
template_preprocess_layoutto exist in$theme_definitions['test_layout_theme']['preprocess functions']. This doesn't exist because we useinitial preprocessnow instead. There is a snippet in\Drupal\Core\Theme\Registry::processExtensionthat is responsible here:I suspect we don't need
testThemeProvidedLayoutanymore, or we need something else to verifyinitial preprocessis set or invoked, specifically for layouts in themes.Comment #8
mstrelan commentedI must have missed it in debugging, but
initial preprocessis right there for us to inspect. Pushed a fix for this.Comment #9
nicxvan commentedLooks right!
I did my normal check except the zebra check.
All deprecations are right
No double __
They all set __FUNCTION__
All initial preprocess are for the correct method.
All comments are correct.
I'll do the zebra check later before marking this.
Comment #10
berdir> I must have missed it in debugging, but initial preprocess is right there for us to inspect. Pushed a fix for this.
It's right there, how useful the assert really is is another question I guess. I already updated a unit test that asserts the output of that method, seems rather unnecessary as there's no actual logic/discovery involved with this, but it also doesn't hurt.
Comment #11
nicxvan commentedHad a chance to do the zebra check looks good to me!
Between this and 9 I think we're good to go on this.
Comment #14
catchCommitted/pushed to 11.x, thanks!