TypeError: Argument must be of type Drupal\Core\Extension\ModuleHandler

Created on 10 October 2023, about 1 year ago
Updated 11 October 2023, about 1 year ago

Problem/Motivation

The settings form for Default Settings throws the following error when a module like Hook Event Dispatcher β†’ (that does service decoration) is installed:

TypeError: Drupal\notify\Form\DefaultForm::__construct(): Argument #3 ($module_handler) must be of type Drupal\Core\Extension\ModuleHandler, Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler given, called in /var/www/docroot/modules/contrib/notify/src/Form/DefaultForm.php on line 57 in Drupal\notify\Form\DefaultForm->__construct() (line 42 of /var/www/docroot/modules/contrib/notify/src/Form/DefaultForm.php).

Steps to reproduce

Enable the notify module and the Hook Event Dispatcher module.
Visit the Default Settings form at /admin/config/people/notify/defaults

Proposed resolution

Follow proper Drupal coding standards and use ModuleHandlerInterface instead of ModuleHandler.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States john.oltman

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024