Problem/Motivation
When a module/theme/profile (extension) is updated, sometimes it may update/add/delete its default config items in the config/install directory.
Currently this has no effect, because config/install is copied into your active config at install time (or possibly when another module it depends on is installed), and never looked at again.
However, it may be useful sometimes to update config, "revert" to the provided config, or add new provided config. Use cases:
- Views UI - in 7.x it had a "Revert" button that would revert a view to its code-provided value. See
#1790398: Re introduce revert functionality for views using the config system β
- Tour - if a module you already installed adds or updates a tour because it added/changed functionality, you'd want the new tour probable. See
π
Tour tips are provided as configuration, so never get updated
Postponed
- The proposed Configurable Help Topics in the currently-sandbox contrib module (didn't make it to Core) also need this, for similar reasons to Tours (they are documentation provided by the module/theme):
https://www.drupal.org/sandbox/jhodgdon/2369943 β
Proposed resolution
End goal
a) Users at need to be able to tell that an extension has changed, added, or deleted default config that it at one time provided for import into the site config.
b) In the case of changes, there should probably be a way for them to view a diff between the config currently in their active config and the version in config/install of the extension, and there should be a way to import the new version. Or they can do nothing and keep their configured version.
c) In the case of additions, there should be an easy way to import the new config.
d) In the case of deletions, they probably just need to be able to discover this, since they can delete config items using the providing module's UI presumably.
How to do it
#2371439: Figure out what to do when module updates configurable topic β
in the issue summary suggests several approaches.
The only really viable one, I think, is to make a report that will check for differences between config items on your site and config items in config/install directories.
It would tell you which items are different from the ones on disk, if there are ones on disk that are missing from active config, and if there are ones in active config that do not exist on disk.
Then it would give you a way to import the missing ones, and view differences and/or import/replace the different ones.
Remaining tasks
Get this into Core eventually? For now the report approach exists as a rough contrib/sandbox at
https://www.drupal.org/sandbox/jhodgdon/2391835 β
User interface changes
Admins will be able to discover config updates and choose what to do about them.
API changes
None.
In order for this to work, we will need to link live config files back to their module-supplied defaults somehow. This will be a followup issue when the original patch lands.