#2416109: Validate configuration dependencies before importing configuration added lots of validation around installing and uninstalling modules and themes. However we forgot to take into account install profiles.

Proposed resolution

The config importer should:

  • Not allow install profiles to be uninstalled
  • Allow modules and themes which are dependencies of install profiles to be uninstalled. These are not real dependencies but really a list of extensions to installed during installation. This is more than a bit odd and yet another reason why install profiles should be allowed to be fully featured modules but this has not been changed by the configuration system.

Remaining tasks

  • Review
  • Commit

User interface changes


API changes


#8 2491987.8.patch7.16 KBalexpott
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 97,327 pass(es). View
#8 3-8-interdiff.txt1.43 KBalexpott
#2 2491987.3.patch7.66 KBalexpott
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 97,331 pass(es). View
#2 2491987.3.test-only.patch4.99 KBalexpott
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 94,580 pass(es), 6 fail(s), and 0 exception(s). View
Members fund testing for the Drupal project. Drupal Association Learn more


alexpott’s picture

Issue summary: View changes
Issue tags: +Configuration system


Not allow multiple install profiles to be installed - this is impossible to test since we don't have multiple profiles that are scanable through extension discovery.

Although this appears sensible extension discovery already takes care of this for us - there can be only one profile. Manual testing by creating a profile in the modules directory proved this to be so.

alexpott’s picture

Status: Active » Needs review
4.99 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 94,580 pass(es), 6 fail(s), and 0 exception(s). View
7.66 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 97,331 pass(es). View

The last submitted patch, 2: 2491987.3.test-only.patch, failed testing.

alexpott queued 2: 2491987.3.patch for re-testing.

alexpott’s picture

Issue summary: View changes
Leksat’s picture

Status: Needs review » Reviewed & tested by the community

I've met the dependency issue. My STR:
1. installed Drupal with the Standard profile
2. created the second site instance
3. uninstalled the Contact module on the first instance
4. tried to import configuration on the second instance
Actual result: error message: Unable to uninstall the Contact module since the Standard module is installed.

After applying the patch #2, configuration was imported successfully.

catch’s picture

+++ b/core/lib/Drupal/Core/EventSubscriber/ConfigImportSubscriber.php
@@ -319,4 +327,18 @@ protected function getNames(array $names, array $extension_data) {
+  protected function drupalGetProfile() {

Is this worth adding? It's a one-line method used once.

Otherwise looks good.

alexpott’s picture

1.43 KB
7.16 KB
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 97,327 pass(es). View

@catch - yep this is because at one point it wrapped some procedural code.

Leaving at rtbc cause this is a tiny change.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

  • catch committed 4e787ea on 8.0.x
    Issue #2491987 by alexpott: Config import validation needs to take into...

Status: Fixed » Closed (fixed)

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