Change config as if the modules defined in config_exclude_modules had been uninstalled

Created on 1 September 2021, over 3 years ago
Updated 30 April 2024, 7 months ago

Problem/Motivation

The excluded modules feature just removes all config that depends directly or indirectly on the excluded modules from the exported config. This works great for the intended use-case of excluding development modules such as devel. Because devel doesn't add third party settings to all of the config.
But conceptually the operation should be equivalent to uninstalling the modules, exporting the config and then installing the modules again and configuring the modules the same way again.

Steps to reproduce

Install Umami
$settings['config_exclude_modules'] = ['menu_ui'];
Export config
Discover all of the recipe content type is missing.
(This is because node.type.recipe depends on menu_ui because it has third_party_settings for it.)

With this issue the third_party_settings for menu_ui would be removed from node.type.recipe on export and added again on import.

Proposed resolution

Removing the things is easy, adding it back is hard without predictable sorting. (We can maybe sort by the active config)
(see an experiment in contrib: #3170204: Add option to remove modules as if they were uninstalled β†’ )

Remaining tasks

tbd,

User interface changes

none

API changes

none

Data model changes

none

Release notes snippet

Excluded modules change the configuration as if they had been uninstalled instead of removing all dependent config.

✨ Feature request
Status

Needs work

Version

11.0 πŸ”₯

Component
ConfigurationΒ  β†’

Last updated 7 days ago

Created by

πŸ‡¨πŸ‡­Switzerland bircher πŸ‡¨πŸ‡Ώ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡·πŸ‡ΈSerbia holo96

    I guess we will need tests for this
    Maybe even to update existing ones

    But let's first do maual testing.

    PS. Roles are also updated at least in drupal 10 where I tested this.

  • Status changed to Needs review over 1 year ago
  • Open on Drupal.org β†’
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    Waiting for branch to pass
  • Status changed to Needs work over 1 year ago
  • πŸ‡¨πŸ‡­Switzerland bircher πŸ‡¨πŸ‡Ώ

    The patch in 8 is a good start, but it is far from complete. It currently does the removing only. It also needs to put the removed config back in a "patch" way, otherwise on an import the removed things will not be added again. I think it would be best to start with a test here.

    The test would have a config which changes when a module is excluded. (such as a role having the permission removed)
    The test should assert that the permission is not present in the exported config, but when importing the config again the permission should be set again. At the very least. There are other cases we should test too but this would be a good start.

  • πŸ‡ΊπŸ‡ΈUnited States seanr

    I can confirm patch in #8 only partially fixes it. It's a damned good thing I watch those config diffs like a hawk. 🀣 FWIW, I'm now using https://www.drupal.org/project/config_ignore β†’ and I recommend that anyway as it's targeted to specific configs rather than the whole module.

Production build 0.71.5 2024