Invalid Argument

Created on 1 February 2024, 5 months ago
Updated 15 February 2024, 4 months ago

Problem/Motivation

TypeError: Drupal\site_settings\SiteSettingsReplicator::__construct(): Argument #2 ($messenger) must be of type Drupal\Core\Messenger\Messenger, string given, called in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 259 in Drupal\site_settings\SiteSettingsReplicator->__construct() (line 57 of /var/www/html/web/modules/contrib/site_settings/src/SiteSettingsReplicator.php).

Steps to reproduce

Run a service scan using drush to get all services id (Tried this not in related to get this error. But there may be other ways that will throw this error). This error is not shown in the log before then however.
drush ev 'foreach (\Drupal::getContainer()->getServiceIds() as $id) { $a[$id] = is_object(\Drupal::service($id)) ? get_class(\Drupal::service($id)) : ""; } dump($a);'

Proposed resolution

Pass correct param in service.

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India MukhtarM

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

Comments & Activities

Production build 0.69.0 2024