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.
Comment | File | Size | Author |
---|---|---|---|
#12 | 2877119-12.patch | 3.34 KB | alexpott |
#12 | 2877119-12.test-only.patch | 2.51 KB | alexpott |
#2 | drupal-2877119-2.patch | 1.16 KB | Dane Powell |
Comments
Comment #2
Dane Powell CreditAttribution: Dane Powell at Acquia commentedComment #3
sch2 CreditAttribution: sch2 commentedSmall 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.
Comment #4
Gábor HojtsyHow 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?
Comment #5
Dane Powell CreditAttribution: Dane Powell at Acquia commentedThis validation was originally added as part of #2234159: Fix config importing through the UI and change ConfigImportAll test using the UI, which states:
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)
Comment #7
Dane Powell CreditAttribution: Dane Powell at Acquia commented@Gábor Hojtsy does this address your concerns? Can we RTBC this?
Comment #8
Gábor HojtsyThanks for the info. I don't feel comfortable committing this myself, but this will help other committers to decide.
Comment #9
Wim LeersReminds me of #2931883: Unneeded always_populate_raw_post_data requirements check while on CLI. Also CLI-related.
Comment #11
alexpottWe 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.
Comment #12
alexpottLike so.
Comment #14
Dane Powell CreditAttribution: Dane Powell at Acquia commentedLooks good to me, thanks! Test fail is expected.
Comment #17
larowlanCommitted as 6ab577b and pushed to 8.6.x.
Cherry-picked as da354c7 and pushed to 8.5.x