Problem/Motivation
I got this error for the Drupal 10 and php 8.1
NOTICE: PHP message: Uncaught PHP Exception Error: "Call to undefined method Drupal\Core\Extension\ModuleHandler::getImplementations()" at /var/www/html/web/modules/contrib/hook_event_dispatcher/src/HookEventDispatcherModuleHandlerProxyTrait.php line 114
CR: https://www.drupal.org/node/3000490
Proposed resolution
We should remove the method getImplementations() from HookEventDispatcherModuleHandlerProxyTrait.php
/**
* {@inheritdoc}
*/
public function getImplementations($hook) {
return $this->inner->getImplementations($hook);
}| Comment | File | Size | Author |
|---|---|---|---|
| #16 | 3380632-3.patch | 2.44 KB | rishabjasrotia |
| #13 | 3380632-2.patch | 1.58 KB | rishabjasrotia |
| #5 | 3380632-1.patch | 889 bytes | rishabjasrotia |
Issue fork hook_event_dispatcher-3380632
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:
Comments
Comment #2
rishabjasrotia commentedComment #4
rishabjasrotia commentedComment #5
rishabjasrotia commentedComment #6
rishabjasrotia commentedComment #7
rishabjasrotia commentedComment #8
dineshkumarbollu commentedHi
Removing code results functionality changes
getImplementations()now is replacing withinvokeAllWith()can you check once.Comment #9
rishabjasrotia commentedHello @dineshkumarbollu,
The
invokeAllWith()method is already defined inHookEventDispatcherModuleHandlerProxyTrait.phpThe old Drupal 9 method was defined which causes the fata error. Removal of Deprecated code is the possible solution.
The 4.x branch is strictly for Drupal 10.
Comment #10
el7cosmosThanks @rishab, there is one PHPCS error (https://git.drupalcode.org/project/hook_event_dispatcher/-/pipelines/157...), can you fix that?
Comment #12
akshay.singh commented@el7cosmos,
Please review
Thanks
Comment #13
rishabjasrotia commentedHello @el7cosmos,
It is handled by @akshay.singh
Comment #14
el7cosmosAccording to https://www.drupal.org/node/3000490, we should also remove
implementsHook()method.Comment #15
rishabjasrotia commentedHello @el7cosmos,
Please Review.
Comment #16
rishabjasrotia commentedComment #18
el7cosmosThanks!
Comment #20
broonI am not sure if I am missing something, but when using the patch from #16 or using the current dev version, I'll got the following error:
Comment #21
broonScrap that, working as designed. Due to an unmet dependency, my dev system was not updated to 10.0.10 as intended but rather to 10.0.0-alpha4.