config:import changed to support config.storage.sync service for default instance #3902
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reason for this pull request:
I'm trying to use the drupal/config_ignore module, which in turn relies on drupal/config_filter module to maintain a separate local dev/staging/prod configuration. Config_ignore has changed how it works internally and relies on config_filter to provide the filtering mechanism. config_filter in turn decorates the config.storage.staging/sync service in order to inject it's own FilteredStorage class to handle the filtering. But the current Drupal console class
src/Command/Config/ImportCommand.php
creates a FileStorage instance directly inside it's execute command, instead of relying on the instance returned from\Drupal::service('config.storage.sync')
. Thus the decorated class is never made available to the import command and the import filtering does not work.This pull request changes the ImportCommand so that in the default case (no
--directory
option provided) it uses theFileStorage
instance from the service container instead of creating it's own local instance. AFAIK this does not break anything, but adds the possibility to override the filestorage by using decorators, like what the config_filter module does.