Problem/Motivation

Currently when you unenforce a config object (eg. uncheck the "enforce this config" checkbox in the CE floaty window), the behaviour is to delete the config object entirely, both from active storage and on disk. This was a design decision which we should reconsider, since it's only *sometimes* what we want. In some cases (at least), we probably want to leave the config object intact (at least in active, if not also on disk), but simply remove it from the config_enforce registry. Currently the only way to accomplish this is by manually removing the config object in question from the registry file, which is obviously non-optimal.

Steps to reproduce

I'm going from memory here, so we should probably confirm this description is correct:

  1. Create a config enforcement setting for some config object, eg. system.site.
  2. Customize the system.site.sitename setting on the admin/system/site-information page.
  3. Observe that the system.site.yml file on disk contains your custom site name.
  4. Uncheck the "Enforce" checkbox on Config Enforce Devel's UI
  5. Observe that the system.site.yml file on disk is deleted.
  6. Observe that the custom site name is no longer present on the admin/system/site-information page.

Proposed resolution

Allow users to choose the behaviour they would like when unenforcing a config object. This will be a bit of a UX challenge, but ideally I imagine there are 3 choices:

1. Remove the config object entirely, from enforcement, from active, and from disk.
2. Remove the config object from enforcement and disk, but leave in active storage.
3. Remove the config object from enforcement, but leave intact on disk and in active storage.

Remaining tasks

1. Dream up a UX workflow to accomplish this
2. Implement it.
3. Document this behaviour.

User interface changes

TBD

API changes

None

Data model changes

None

Comments

spiderman created an issue. See original summary.

star-szr’s picture

Version: 1.0.x-dev » 2.0.x-dev
Status: Active » Fixed

I'm not sure when this changed, but at least on 2.0.x I can't reproduce this bug.

Looking at the code, I think the relevant method here is Drupal\config_enforce_devel\EnforcedConfigCollection::deleteEnforcedConfigs(), which doesn't seem to touch the actual config, just the enforcement settings as I would expect.

I'm going to mark this as fixed.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.