I have a circumstance where I get errors in the config page

Created on 1 November 2023, about 1 year ago

Problem/Motivation

Visiting the config page to grab the API Key I get the followoing error message:

TypeError: Drupal\site_guardian\Services\SiteGuardianService::__construct(): Argument #3 ($module_handler) must be of type Drupal\Core\Extension\ModuleHandler, Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler given, called in /var/www/html/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\site_guardian\Services\SiteGuardianService->__construct() (line 73 of modules/contrib/site_guardian/src/Services/SiteGuardianService.php).

Proposed resolution

I think we should use the ModuleHandlerInterface instead of the ModuleHandler implementation, I suspect other modules are decorating this class and it is leading to the fatal error.

Remaining tasks

Change the code to use ModuleHandlerInterface instead of ModuleHandler in the service.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom the_g_bomb

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

Comments & Activities

Production build 0.71.5 2024