Use ModuleHandlerInterface, not ModuleHandler

Created on 1 September 2025, about 1 month ago

Problem/Motivation

ContentNotifyManager requests \Drupal\Core\Extension\ModuleHandler as it's first construction argument.

However modules such as hook_event_dispatcher replaces the default class with \Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler.

This should not matter as both classes implement the ModuleHandlerInterface, however because ContentNotifyManager does not use the interface this breaks the site.

Steps to reproduce

Pass in any class that implements ModuleHandlerInterface that is not ModuleHandler.

Proposed resolution

Request the interface not the class.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom dahousecat

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

Comments & Activities

Production build 0.71.5 2024