5

Drupal 8.8 introduced a new setting: https://www.drupal.org/node/3079028

By adding these lines to your settings.local.php I expected the modules and their configuration to be excluded from config export.

$settings['config_exclude_modules'] = ['kint', 'devel'];

However:

  • kint and devel still appear in my core.extensions.yml
  • Yaml files related to devel still get generated.
  • Modules are still removed and installed based on the core.extensions.yml

How does this feature work?

Edit: I upgraded from Drupal 8.7, that seems to keep this function to work properly.

3

Enable the module and activate the filter by declaring $settings['config_exclude_modules'] in your settings.php file, eg:

$settings['config_exclude_modules'] = ['devel', 'stage_file_proxy'];

Now, when you export configuration (drush config-export), the selected modules should no longer show up in core.extension.yml and their configuration should not be exported.

Make sure first before doing that to remove these module from core.extensions.yml manually for the first time.

Update: It seems to be related to a drush issues: drush config:status does not respect excluded modules #4194

| improve this answer | |
  • 2
    When I do so, after I do drush config-export it overwrites core.extensions.yml. When I remove them and do drush config-import it uninstalls the devel and stage_file_proxy module. – Erlend ter Maat Mar 12 at 9:38
  • 1
    It works as expected for fresh installations of Drupal 8.8 – Erlend ter Maat Mar 12 at 20:30
  • 1
    It did not work out well for my upgraded 8.7 to 8.8 install, but it makes sense to first remove the yml files. Else errors show you the way to what yaml files you should remove to make it work. – Erlend ter Maat Mar 16 at 11:49
0

I'm on Drupal 8.9.2 and this does not work.

I have $settings['config_exclude_modules'] = ['stage_file_proxy']; in my settings.php.

I've removed the module from the core.extension.yml file but when I run drush cex it pops straight back in there. When I run drush cim if the module line is removed from core.extension.yml drupal then tries to uninstall it from the local site.

Is there any other way of specifying what modules should exist in which environment?

Edit: Confirmed - this feature does not work: https://www.drupal.org/project/drupal/issues/3102435#comment-13580861

Edit 2: It does work but needs Drush 10! I got it working with Drupal 8.9.2 and drush 10.3.1

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.