If you remove the config module from core.extensions.yml and try to perform a config sync using drush config-import, the sync will fail with this error:

Can not uninstall the Configuration module as part of a configuration synchronization through the user interface.

Obviously this is a little unexpected, since the uninstall is being performed via the command line, not the UI.

The config module has a subscriber that checks if it is being uninstalled as part of a configuration sync, presumably in order to prevent the sync itself from breaking. But this shouldn't be an issue if you aren't using the UI, so I think this check should have a conditional to allow uninstall during syncs invoked via the command line.

Patch forthcoming.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dane Powell created an issue. See original summary.

Dane Powell’s picture

Status: Active » Needs review
FileSize
1.16 KB
sch2’s picture

Version: 8.3.x-dev » 8.4.x-dev
Status: Needs review » Reviewed & tested by the community

Small and efficient patch. Worked nicely, thank you.

Since 8.3.x is released, I think the patch should be against 8.4.x-dev branch.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Needs review

How do we know that no other functionality in the config module is expected to run otherwise. It could very well be that the error message was worded imprecisely and it is not only a problem with the UI. Can you help at least dig up the discussion where we added this error message and why did we do it?

Dane Powell’s picture

This validation was originally added as part of #2234159: Fix config importing through the UI and change ConfigImportAll test using the UI, which states:

A new config import validation event prevents the config module from being uninstalled so that the route will still exist after importing

So the point of this validation was just to make sure that the route didn't disappear during import, which is only a concern when using the UI. I can't imagine it has any fallout if you are importing via Drush.

This is actually somewhat related to #2877111: Rename Config module to "Config UI" (the core config module is really just a fancy UI and isn't necessary for non-UI config operations)

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

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now 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.

Dane Powell’s picture

@Gábor Hojtsy does this address your concerns? Can we RTBC this?

Gábor Hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the info. I don't feel comfortable committing this myself, but this will help other committers to decide.

Wim Leers’s picture

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

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now 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.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

We have test coverage of the UI aspect of this in \Drupal\Tests\config\Functional\ConfigImportUITest::testConfigUninstallConfigException(). The Config module does only provide UI functionality so it should be uninstallable via config-import from the CLI. I think we should add a kernel test to the Config module (similar to \Drupal\KernelTests\Core\Config\ConfigImporterTest to test that CLI uninstall of config is possible via config import. The test should skip if the test is not being run via the CLI.

alexpott’s picture

Status: Needs work » Needs review
FileSize
2.51 KB
3.34 KB

Like so.

The last submitted patch, 12: 2877119-12.test-only.patch, failed testing. View results

Dane Powell’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me, thanks! Test fail is expected.

  • larowlan committed 6ab577b on 8.6.x
    Issue #2877119 by alexpott, Dane Powell: Cannot uninstall Config module...

  • larowlan committed da354c7 on 8.5.x
    Issue #2877119 by alexpott, Dane Powell: Cannot uninstall Config module...
larowlan’s picture

Version: 8.6.x-dev » 8.5.x-dev
Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs tests

Committed as 6ab577b and pushed to 8.6.x.

Cherry-picked as da354c7 and pushed to 8.5.x

Status: Fixed » Closed (fixed)

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