Argument #2 ($moduleHandler) must be of type Drupal\Core\Extension\ModuleHandler, Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler given

Created on 3 October 2024, 3 months ago

Problem/Motivation

We have some custom classes that when we install this module Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler replaces \Drupal\Core\Extension\ModuleHandler.

This is the first time I have ever installed a package where our custom code using dependency injection needed updating.

This is one snippet of code I had to change across two files.

  /**
   * The module handler service.
   *
   * @var \Drupal\Core\Extension\ModuleHandler
   */
  protected ModuleHandler $moduleHandler;

is updated to

  /**
   * The module handler service.
   *
   * @var \Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler
   */
  protected HookEventDispatcherModuleHandler $moduleHandler;
๐Ÿ’ฌ Support request
Status

Active

Version

4.2

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States pbabin

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

Comments & Activities

Production build 0.71.5 2024