Problem/Motivation

#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

None

API changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott’s picture

Issue summary: View changes
Issue tags: +Configuration system

Removed

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
FileSize
4.99 KB
7.66 KB

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

FileSize
1.43 KB
7.16 KB

@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.