Problem/Motivation
This module should use ModuleHandlerInterface instead of ModuleHandler to avoid issues with other modules.
When using the Hook Event Dispatcher module after 3.2.0, the settings page for CKEditor Media Embed Plugin returns this error:
TypeError: Argument 2 passed to Drupal\ckeditor_media_embed\Form\CKEditorMediaEmbedSettingsForm::__construct() must be an instance of Drupal\Core\Extension\ModuleHandler, instance of Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler given, called in /app/web/modules/contrib/ckeditor_media_embed/src/Form/CKEditorMediaEmbedSettingsForm.php on line 73 in Drupal\ckeditor_media_embed\Form\CKEditorMediaEmbedSettingsForm->__construct() (line 57 of /app/web/modules/contrib/ckeditor_media_embed/src/Form/CKEditorMediaEmbedSettingsForm.php)
See the hook_event_dispatcher release notes.
Proposed resolution
Type hint ModuleHandlerInterface instead of ModuleHandler.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3314733-2.patch | 2.01 KB | pieter-e1 |
Comments
Comment #2
pieter-e1 commentedPatch attached.
Comment #3
dpiMany people are seeing errors related to ModuleHandler as a result of upgrading Hook Event Dispatcher, which includes a module handler service decorator.
Projects need to ensure interfaces are used while injecting services, so this project will need to make the code change here.
Comment #4
pieter-e1 commentedComment #5
lamp5Confirmed, the patch works for 2.0.0-alpha.
Comment #8
grndlvl commented