Problem/Motivation
When a deprecated hook is altered using a hook attribute instead of a procedural hook the method is not stored for the deprecation.
Steps to reproduce
Convert the test module deprecation_test to OOP hooks and core/tests/Drupal/KernelTests/Core/Extension/ModuleHandlerDeprecatedHookTest.php will fail.
Proposed resolution
Handle both alter deprecations for both OOP and procedural hooks.
Update the message to refer to only the location so it works for both procedural and OOP.
Remaining tasks
Also should we add a message if the alter test is failing that the deprecation procedural hook should not be converted until it's the last one?
Is the module implementing the hook enough for the deprecation message?
User interface changes
N/A
Introduced terminology
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
Issue fork drupal-3482618
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:
- 3482618-modulehandler-alterdeprecated-does-not
changes, plain diff MR !9911
Comments
Comment #3
nicxvan commentedOk this test should be passing, it likely needs some cleanup, but it's getting really late and I'd like a review on direction.
I'm not sure if major is correct, please downgrade if not.
Comment #4
nicxvan commentedComment #5
nicxvan commentedComment #6
godotislateNits: I think the convention is document as
{class name}::{method name}instead of{class name}->{method name}.Comment #7
nicxvan commentedGreat catch thanks! I've updated it.
Comment #8
godotislatelgtm
Comment #11
catchThis looks good to me, couldn't find anything to complain about.
Committed/pushed to 11.x and cherry-picked to 11.1.x, thanks!