hechoendrupal / drupal-console

The Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.
http://drupalconsole.com
GNU General Public License v2.0
940 stars 559 forks source link

[drupal config:export] Support core setting config_exclude_modules #4267

Open mariacha opened 4 years ago

mariacha commented 4 years ago

Problem/Motivation

But the command drupal config:export does not honor that setting.

How to reproduce

  1. Enable a module, like devel on your local site.
  2. Add the devel module to the list of excluded configuration in your settings.local.php file:
$settings['config_exclude_modules'] = ['devel'];
  1. Export your site's config using drush>10 with drush cex OR using the admin interface at /admin/config/development/configuration/full/export. You should not have any devel.settings.yml files, and your core.extension.yml file should not reference the devel module.

  2. Now run drupal config:export.

  3. Notice that there is now a devel.settings.yml file (among other devel files), and your core.extension.yml lists devel as a module.

Solution

Drush added support for this to the 10.rc-3 version with this commit: https://github.com/drush-ops/drush/commit/11cc24b7f55b26ddff2a638824eb16bb6dcb5f1e. It looks like the magic is in an additional call with a parameter in the service, but I don't know how translatable that is to the drupal console: https://github.com/drush-ops/drush/commit/11cc24b7f55b26ddff2a638824eb16bb6dcb5f1e#diff-688fa7217de68ca8060c51c10c1cd249R6

bircher commented 4 years ago

The magic was added to drush here: https://github.com/drush-ops/drush/pull/4061 when exporting simply use the export storage and when importing use the import transformer to transform the storage before passing it on to the config importer. See also: https://www.drupal.org/node/3037022 and https://www.drupal.org/node/3066005#invoking-transformer