Inject ModuleHandlerInterface in constructor for AiInterpolatorFieldConfig

Created on 5 April 2024, 7 months ago
Updated 19 April 2024, 7 months ago

Problem/Motivation

When this module is installed alongside Hook Event Dispatcher β†’ , then this error results when trying to create an ElevenLabs Field β†’ :

TypeError: Drupal\ai_interpolator\FormAlter\AiInterpolatorFieldConfig::__construct(): Argument #4 ($moduleHandler) must be of type Drupal\Core\Extension\ModuleHandler, Drupal\hook_event_dispatcher\HookEventDispatcherModuleHandler given, called in /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\ai_interpolator\FormAlter\AiInterpolatorFieldConfig->__construct() (line 63 of modules/contrib/ai_interpolator/src/FormAlter/AiInterpolatorFieldConfig.php).

Steps to reproduce

Install and enable these modules: Hook Event Dispatcher, AI Interpolator, ElevenLabs Field, and AI Interpolator Elevenlabs. Then try to create an ElevenLabs field.

Proposed resolution

Update line 63 of the Drupal\ai_interpolator\FormAlter\AiInterpolatorFieldConfig class to typecast with Drupal\Core\Extension\ModuleHandlerInterface rather than Drupal\Core\Extension\ModuleHandler.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States SpaceGoat1701

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024