Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
15 Jul 2025 at 02:03 UTC
Updated:
31 Jul 2025 at 08:44 UTC
Jump to comment: Most recent
There were four preprocess hooks missed in bulk conversion because they were not documented.
Convert these preprocess to OOP and mark as skip procedural scanning
Do it.
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
nicxvan commentedComment #4
nicxvan commentedComment #5
mstrelan commentedOne comment on the @todo item for #939462: Specific preprocess functions for theme hook suggestions are not invoked otherwise looks good.
Comment #6
berdirOne note: If we then indeed converted all module preprocess to OOP then that means we wouldn't have any test coverage of the BC layer for this.
On the plus side, that means we can formally deprecate legacy preprocess functions and as part of that, introduce one example in a test module to ensure that deprecations are triggered correctly, lets make sure we have an issue for that.
Comment #7
nicxvan commentedYes I meant to add one to the legacy hook module. But technically there are themes implementing them still.
Comment #8
nicxvan commentedCreated follow ups.
Comment #9
mstrelan commentedConfirmed all hooks still working:
CommentThemeHooks::preprocessFieldinvoked in\Drupal\Tests\comment\Functional\CommentNonNodeTestMediaLibraryThemeHooks::preprocessViewsViewMediaLibraryis invoked inMediaLibraryTestBase::assertMediaLibraryGridViewsThemeHooks::preprocessNodeis invoked in\Drupal\Tests\views\Kernel\Entity\RowEntityRenderersTest::testEntityRenderersViewsThemeHooks::preprocessCommentis invoked in\Drupal\Tests\comment\Functional\CommentRssTest::testCommentRssComment #10
catchAgreed with the two follow-ups, but there is one outdated comment I think we should delete here. Would have done it in gitlab suggestions but it's not letting me delete those three lines in a suggestion.
Comment #11
nicxvan commentedRemoved that comment block!
FYI if there is a comment on a line you can't do a multiline suggestion by dragging the comment icon.
You can either do two suggestions, one for the line with the comment and a single for the other lines.
Or you can click the suggestion then change the line numbers in the comment, but that gets tricky, I think desktop will update to show you what you are editing, but phone won't.
Either way I don't mind making the change myself, just sharing some gitlab tips I've discovered.
Comment #12
nicxvan commentedComment #13
nicxvan commentedAlso removed ProceduralHookScanStop here for media module as @berdir pointed out here: #3494908: Set skip procedural scanning for all modules in core
Comment #14
mstrelan commentedThink this is back to NW for @berdir's latest comment about the ProceduralHookScanStop
Comment #15
nicxvan commentedNope, I took care of that this morning, ready for review!
Comment #16
nicxvan commentedOh in the mr! Sorry you're right!
Comment #17
nicxvan commentedI undid the media changes
Comment #18
mstrelan commentedThink this is good to go. Failing test is unrelated.
Comment #19
catchCommitted/pushed to 11.x, thanks!
Comment #21
catch