Hello,
When I try to revert my features with Drush. The wrong configuration files are imported.
My use case, I am developing a distrib for french Drupalcamps : https://github.com/Drupal-FR/socle-drupalcampfr
In my installation profile I have exported system.theme.yml with the good theme values.
But if I import the features: $DRUSH features-import -y --force --bundle=drupalcampfr drupalcampfr
It is the configuration from core/modules/system/config/install/system.theme.yml which is imported.
Note: I use the --force option because some components don't want to be reverted but even with that I still get some features marked as overriden... But it is another problem.
I will try to see why I have this behaviour.
Comments
Comment #2
GrimreaperI tracked the problem.
In drush/features.drush.inc, drush_features_import():
In the $config, I have a key system.theme well set, and detected from my installation profile with the good values. (EDIT: not the good values, the values from the active configuration)
So it is in the service from config_update called in:
That the import is not done on the right file.
Should I put this issue into config_update issue queue? Or should this be handled in Features?
Note: I don't know if it is already into an issue but the function drush_features_list() doesn't exist.
Comment #3
nedjoThis issue is related: #2430541: Document handling of configuration provided in multiple sources.
Comment #4
nedjoGood catch. Please open a new issue.
Comment #5
GrimreaperHello nedjo,
Issue open for drush_features_list(): #2672682: Undefined function drush_features_list()
I will see the next weekend about the related issue in config_update, thanks.
Comment #6
GrimreaperI continue to search the source of the problem. There is something interesting.
If I isolate the case of system.theme.yml
In core/lib/Drupal/Core/Config/FileStorage.php read():
returns core/modules/system/config/install/system.theme.yml after a direct call from the revert() function in ConfigReverter.php
But later in the revert() function:
triggers an event and a LocaleConfigManager call read() of FileStorage.php and then it is the good filepath (and data) which is returned: profiles/custom/drupalcampfr/config/install/system.theme.yml
I wonder if I should continue research to find the origin of the problem or if I should create a service to revert with Drush.
Comment #7
GrimreaperIf I try to revert in Features UI my theme settings, I have the same problem.
It is the file from core/modules/system/config/install/system.theme.yml which is read.
EDIT: If I put my system.theme.yml into a features module then the revert works. So I will check for profile conditions into Features.
Comment #8
GrimreaperRenaming the issue title has it also does not work in the UI.
Comment #9
GrimreaperEditing git repository URL.
Comment #10
GrimreaperHello,
I have tested the 8.3.0-beta8 version.
If in features/src/FeaturesManager.php initPackageFromExtension(), I replace:
Which corresponds to a revert of #2745023: Features Drush commands are using shortname instead of the expected module name (fullname).
It works.