Problem/Motivation

#2140511: Configuration file name collisions silently ignored for default configuration prevented default configuration collisions but special-cased install profiles, meaning that a site's install profile may provide configuration items already provided by an installed module. Currently the standard profile provides two such items (system.cron and system.theme), both simple configuration items already provided by the system module.

However, it's unclear that the special casing for install profiles will provide significant benefit. In Drupal 7, most complex install profiles divide default configuration among multiple modules so that configuration bundles can be selectively enabled. Work has begun to replicate this functionality in Drupal 8. There are no strong indications that distributions will start to put all their configuration into an install profile.

So it appears the considerable complexity added by special casing install profiles may not be justified. Distributions likely will not benefit from it, and will instead have to provide their own solution to achieve the same end.

Proposed resolution

Remove the special casing. In the standard profile, make required customizations to existing configuration in hook_install().

Remaining tasks

User interface changes

API changes

Comments

nedjo’s picture

Title: Review/remove PreExistingConfigException special casing for install profile » Review PreExistingConfigException special casing for install profile
Issue summary: View changes
mpotter’s picture

I'd like to see this issue get more attention also. There needs to be a general, clean, documented method for allowing a module to be installed that contains conflicting configuration, even if it means the configuration from that module is ignored in favor of the existing site config. Causing an exception and failing the module install is a poor solution.

I can currently install a module with no config, then later add a config file to the module and yet the module remains enabled. I can then use code or modules like config_update to load that new config into the active store. So what was the point of preventing the module from being installed with the config in the first place?

What if I create a View and then I want to put that view into my module? I cannot install the module because the view already exists in the active store. I have to export the view, then *delete* the view, then add the view config to my module and then enable it. Again, a mess of a workaround.

The exceptions made for install profiles seem like a kludge only designed to handle the case of the standard drupal install that needs to override some config. But this is not just an issue with install profiles. There are many use cases especially in development of modules where you need to install a module that just happens to have existing config in it.

I'm not even trying to debate the issue here of config overrides. I'd be happy if installing the module just ignored the module's config if it already exists, just as if the module was originally installed and then the site config was changed. The site config can still be the "master". But please let me still enable the module somehow!

pjcdawkins’s picture

alexpott’s picture

#3 is not related.

re #2 quite a few of the problems are resolved by optional configuration and #2461513: The ConfigInstaller should add a dependency on the extension used to install the configuration

So this is a complex issue. We have tension between modules providing functionality and configuration (expressions of that functionality) - a lot has moved to install profiles in core. But in my mind not enough has. For example, think views.view.frontpage does not belong in the node module. I think it should be in standard profile. However this does not help with contributed modules that a distribution uses.

As for a solution to the problem where a distribution wants to override configuration provided by a module the only solution I can think of is some override key in the install profile .info.yml file that has the module name and configuration name which would be checked by the config installer.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
nedjo’s picture

From the current documentation on proposed Composer project templates:

Install profiles are able to override existing configuration during an
installation. It is proposed that this functionality is deprecated in favour of
Drupal recipes and their ability to modify existing configuration on
application.

So adding "Distribution Modernization Initiative" tag.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.