Update getConfigImporter for Drupal 11 compatibility

Created on 6 May 2025, about 1 month ago

Problem/Motivation

Config Enforce does not currently work in Drupal 11, failing while trying to import (enforce) configs.

Steps to reproduce

  1. Load Config Enforce into a Drupal 11 site using this issue fork: https://git.drupalcode.org/project/config_enforce/-/merge_requests/25
  2. Run drush cr

Expected result would be a cache clear and enforcing configs.

Actual result is a PHP fatal error:

PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function Drupal\Core\Config\ConfigImporter::__construct(), 10 passed in /var/www/html/.local-dev/web/modules/contrib/config_enforce/src/ConfigImporter.php on line 125 and exactly 11 expected in /var/www/html/.local-dev/web/core/lib/Drupal/Core/Config/ConfigImporter.php:204

Proposed resolution

Add the missing argument. Older versions of Drupal which are still expecting 10 arguments will ignore the additional argument.

Remaining tasks

  • Create MR with the change
  • Review

User interface changes

n/a

API changes

n/a

Data model changes

n/a

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada star-szr

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

Comments & Activities

Production build 0.71.5 2024