Problem/Motivation
@berdir pointed out that I forgot to leave a couple of test hooks for themes to ensure we don't break procedural hooks.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3579629
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:
- 3579629-add-procedural-hooks
changes, plain diff MR !15130
Comments
Comment #2
nicxvan commentedComment #3
nicxvan commentedStill need to add preprocess and preprocess_HOOK, but got a super simple kernel test for checking collecting and executing procedural hooks in themes.
Comment #5
nicxvan commentedAdded some fairly simple tests to confirm that procedural hooks and preprocess hooks are picked up.
I also added a test to confirm LegacyHook works as expected.
Comment #6
nicxvan commentedMoving to normal because there are a couple of procedural hooks still, but we really should have explicit coverage since the remaining ones are being converted.
Comment #7
nicxvan commentedComment #8
berdir> Moving to normal because there are a couple of procedural hooks still, but we really should have explicit coverage since the remaining ones are being converted.
True, but they will vanish quick enough.
Added some minor remarks, once we deprecate having .theme files explicitly we can then just add the necessary expected deprecations here.
Comment #9
nicxvan commentedYep, I would bump the priority I think if those get in first.
I addressed your feedback, thank you.
Comment #10
nicxvan commentedOther two are in this is major at least now.
Comment #11
berdirOne more thing.
Comment #12
nicxvan commentedI was thinking we should probably do that too.
Comment #13
nicxvan commentedComment #14
nicxvan commentedI was not successful in converting it to a kernel test, but I added real rendering. The browser test is real rendering so I think it is actually better coverage.
I think this covers the procedural theme pipeline.
Comment #15
nicxvan commentedComment #16
berdirPer #14, there were some issues trying to do all of this in a kernel test. I'm not sure why, I think it should be possible and I pondered if I should look into it myself. I decided against it, I think it doesn't hurt to have some full functional testing of this and not just kernel tests, wouldn't be the first time that something only worked in a kernel/unit test due to setup that didn't actually match a real size.
This is major because it a) helps us guarantee that the BC layer continues to work until 13.0 and it the tests added here can be converted directly to deprecation tests for the #3581218: Deprecate .theme file extension so that we have tests for that.
Comment #17
godotislateOnly guessing since I don't know what the issues were, but if you need to use node entities in kernel tests, you need to add both
nodeanduserto$modules. See https://www.drupal.org/node/3539877I think a full functional test is fine though.
Some comments on the MR.
Comment #18
nicxvan commentedI addressed all of your feedback thanks!
I bet that was it, but I think functional still provides better coverage here.
Comment #19
nicxvan commentedFixed the last comment, @godotislate mentioned in slack I could self RTBC once it was green again.
Comment #24
godotislateCommitted and pushed 036963e to main, abda4b5 to 11.x, and 56a8ed2 to 11.3.x. Thanks!