Update ConfigImporterTrait

Created on 11 September 2023, 10 months ago
Updated 19 October 2023, 8 months ago

Problem/Motivation

ConfigImporter requires the theme extension list to be injected →

The above change notice references an issue which has the following in its committed patch:

    if ($extension_list_theme === NULL) {
      @trigger_error('Calling ' . __METHOD__ . ' without the $extension_list_theme argument is deprecated in drupal:10.1.0 and will be required in drupal:11.0.0. See https://www.drupal.org/node/3284397', E_USER_DEPRECATED);
      $extension_list_theme = \Drupal::service('extension.list.theme');
    }
    $this->themeExtensionList = $extension_list_theme;

In other words: When constructing a ConfigImporter one has to pass the theme extension list.

Config Split constructs a few config importers for the forms and drush commands. In order to shield the code which needs the ConfigImporter from the implementation detail of how to construct one (it is not a service available in the drupal container and it shouldn't be) we use a trait. So this trait needs to be updated to pass the theme extension list to the config importer.

I just checked and it seems the patch was backported to 9.5 so we can do it without any BC concerns.

Proposed resolution

Add theme extension list service to config importer constructor.

Remaining tasks

patch, review commit

User interface changes

none

API changes

none.. changes like this is why we have this trait. And the trait is @internal

Data model changes

none

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇨🇭Switzerland bircher 🇨🇿

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

Comments & Activities

Production build 0.69.0 2024