Detect if default configuration of a module has been changed, and allow to restore to the original

Created on 8 January 2012, over 13 years ago
Updated 28 May 2025, 7 days ago

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.

Original report by @heyrocker β†’

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.

✨ Feature request
Status

Postponed: needs info

Component

Idea

Created by

πŸ‡ΊπŸ‡ΈUnited States gdd Portland, OR

Live updates comments and jobs are added and updated live.
  • distributions

    Used in Documentation issues for documentation of distributions

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.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    The Ideas project is being deprecated. This issue is moved to the Drupal project. Check that the selected component is correct. Also, add the relevant tags, especially any 'needs manager review' tags.

    Changing to the standard issue template β†’ would also help other contributors.

    Due to the lack of activity here in the past 7 years, I am setting this to I am setting the status to Postponed (maintainer needs more info.

    Is this feature still of interest?

  • πŸ‡³πŸ‡ΏNew Zealand quietone
Production build 0.71.5 2024