TypeError: ConfigImporter::__construct(): $string_translation must be of type TranslationInterface, null given

Created on 20 November 2024, about 10 hours ago

Problem/Motivation

When importing any ECA model tar file from the ECA Library using
admin/config/workflow/eca/import, we are seeing the following error:

TypeError: Drupal\Core\Config\ConfigImporter::__construct(): Argument #9 ($string_translation) must be of type Drupal\Core\StringTranslation\TranslationInterface, null given, called in .../eca/modules/ui/src/Form/Import.php on line 357 in Drupal\Core\Config\ConfigImporter->__construct() (line 204 of .../core/lib/Drupal/Core/Config/ConfigImporter.php).

This is because $this->stringTranslation inside Drupal\eca_ui\Form\Import is never given a value. This property comes from the parent class, FormBase, but that doesn't give it a value either. (We observed this problem on 2.0.7 but that code is the same in 2.1.x.)

Proposed resolution

Replace $this->stringTranslation with $this->getStringTranslation().

Remaining tasks

Implement.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇨🇦Canada Liam Morland Ontario, CA 🇨🇦

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