Fix TypeError in ConfigurationHelper Constructor Due to Mismatched Container Type

Created on 23 July 2024, 5 months ago
Updated 24 July 2024, 5 months ago

Problem/Motivation

The ConfigurationHelper constructor in the custom_configuration module is expecting an instance of Drupal\Core\DependencyInjection\Container for the $serviceContainer argument. However, it is receiving an instance of Drupal\Core\DependencyInjection\ContainerBuilder instead, causing the TypeError.

While running drush updb, the following error occurs:

TypeError: Drupal\custom_configuration\Helper\ConfigurationHelper::__construct(): Argument #4 ($serviceContainer) must be of type Drupal\Core\DependencyInjection\Container, Drupal\Core\DependencyInjection\ContainerBuilder given in Drupal\custom_configuration\Helper\ConfigurationHelper->__construct() (line 89 of /var/www/html/web/modules/contrib/custom_configuration/src/Helper/ConfigurationHelper.php).

Steps to reproduce

  1. Run drush updb.
  2. Observe the error message indicating the type mismatch.
📌 Task
Status

RTBC

Version

10.0

Component

Code

Created by

🇮🇳India PrasadDeole

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

Comments & Activities

Production build 0.71.5 2024