Use the ModuleHandlerInterface instead of the ModuleHandler concrete implementation

Created on 16 December 2022, almost 2 years ago
Updated 21 May 2024, 6 months ago

Problem/Motivation

When other modules, like hook_event_dispatcher, use ModuleHandler, this module causes an error when trying to edit a rest endpoint, by going to /admin/config/services/rest/resource/entity%3Anode/edit.

Steps to reproduce

Use another module that has ModuleHandler, like hook_event_dispatcher and try to login. The following error is produced:

TypeError: Argument 2 passed to Drupal\restui\Form\RestUIForm::__construct() must be an instance of Drupal\Core\Extension\ModuleHandler, instance of Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler given

Proposed resolution

Patch is provided to use ModuleHandlerInterface and all errors are removed.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇦Canada ebremner

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024