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
| Comment | File | Size | Author |
|---|---|---|---|
| features-drupal11-method-signature-fix.patch | 644 bytes | jbowm2 |
Issue fork features-3536095
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jonasanne commentedI also tested this on 11.2.2 and can confirm it works.
Thanks
Comment #3
jonasanne commentedConverted the patch into a MR.
Comment #5
mark_fullmerNoting that this change is already accounted for in the issue for Drupal 11 compatibility, per https://git.drupalcode.org/project/features/-/merge_requests/39#note_494953 . So, presumably, this issue can be closed in favor of the comprehensive changes in #3447460: Drupal 11 compatibility for Features module
Comment #6
bkosborne