Fix method signature in FeaturesConfigInstaller::findPreExistingConfiguration() for Drupal 11.2+ compatibility

Created on 15 July 2025, 23 days ago

Problem/Motivation

PHP Fatal error: Declaration of Drupal\features\FeaturesConfigInstaller::findPreExistingConfiguration(Drupal\Core\Config\StorageInterface $storage) must be compatible with Drupal\Core\Config\ConfigInstaller::findPreExistingConfiguration(Drupal\Core\Config\StorageInterface $storage, array $previous_config_names = []) in modules/contrib/features/src/FeaturesConfigInstaller.php on line 67

This happens because `ConfigInstaller::findPreExistingConfiguration()` in core was updated in [Drupal 11.2.0]( https://www.drupal.org/project/drupal/releases/11.2.0 β†’ ) to include a new second parameter:
```php
array $previous_config_names = []
The override in Features does not match this updated method signature, causing a fatal error.

When using the Features module with Drupal 11.2.x and higher, the following fatal error occurs when running `drush updb` or similar config-installing operations:

Proposed resolution

Update the method signature in FeaturesConfigInstaller to match Drupal core:

- protected function findPreExistingConfiguration(StorageInterface $storage)
+ protected function findPreExistingConfiguration(StorageInterface $storage, array $previous_config_names = [])

Attached is a simple patch that updates the method signature.

Manually tested on Drupal 11.2.2
Confirmed fix for drush updb
Compatible with existing functionality

πŸ› Bug report
Status

Needs review

Version

3.14

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jbowm2

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

Comments & Activities

Production build 0.71.5 2024