diff -u b/core/lib/Drupal/Core/Config/ConfigImporter.php b/core/lib/Drupal/Core/Config/ConfigImporter.php --- b/core/lib/Drupal/Core/Config/ConfigImporter.php +++ b/core/lib/Drupal/Core/Config/ConfigImporter.php @@ -762,7 +762,7 @@ ->setSourceStorage($this->storageComparer->getSourceStorage()); if ($type == 'module') { if ($op == 'uninstall') { - if ($reasons = $this->moduleInstaller->validateUninstall(array($name))) { + if ($reasons = $this->moduleInstaller->validateUninstall(array($name), FALSE)) { $reasons_string = explode(', ', $reasons); throw new ConfigImporterException("Module $name cannot be safely uninstalled for the following reasons: $reasons_string."); } only in patch2: unchanged: --- a/core/lib/Drupal/Core/Entity/ContentUninstallValidator.php +++ b/core/lib/Drupal/Core/Entity/ContentUninstallValidator.php @@ -33,6 +33,13 @@ public function __construct(EntityManagerInterface $entity_manager, TranslationI /** * {@inheritdoc} */ + public function isConfigurationBased() { + return FALSE; + } + + /** + * {@inheritdoc} + */ public function validate($module) { $entity_types = $this->entityManager->getDefinitions(); $reasons = array(); only in patch2: unchanged: --- a/core/lib/Drupal/Core/Extension/ModuleInstaller.php +++ b/core/lib/Drupal/Core/Extension/ModuleInstaller.php @@ -500,10 +500,13 @@ protected function updateKernel($module_filenames) { /** * {@inheritdoc} */ - public function validateUninstall(array $module_list) { + public function validateUninstall(array $module_list, $configuration_based = TRUE) { $reasons = array(); foreach ($module_list as $module) { foreach ($this->uninstallValidators as $validator) { + if ($configuration_based == FALSE && $validator->isConfigurationBased() == TRUE) { + continue; + } $validation_reasons = $validator->validate($module); if (!empty($validation_reasons)) { if (!isset($reasons[$module])) { only in patch2: unchanged: --- a/core/lib/Drupal/Core/Extension/ModuleInstallerInterface.php +++ b/core/lib/Drupal/Core/Extension/ModuleInstallerInterface.php @@ -74,11 +74,13 @@ public function addUninstallValidator(ModuleUninstallValidatorInterface $uninsta * * @param string[] $module_list * An array of module names. + * @param bool $configuration_based + * Check with configuration-based validators. * * @return string[] * An array of reasons the module can not be uninstalled, empty if it can. */ - public function validateUninstall(array $module_list); + public function validateUninstall(array $module_list, $configuration_based = TRUE); } only in patch2: unchanged: --- a/core/lib/Drupal/Core/Extension/ModuleUninstallValidatorInterface.php +++ b/core/lib/Drupal/Core/Extension/ModuleUninstallValidatorInterface.php @@ -13,6 +13,14 @@ interface ModuleUninstallValidatorInterface { /** + * Indicate if this validator is configuration-based. + * + * @return bool + * TRUE if the validator is configuration-based. + */ + public function isConfigurationBased(); + + /** * Determines the reasons a module can not be uninstalled. * * @param string $module only in patch2: unchanged: --- a/core/lib/Drupal/Core/Field/FieldModuleUninstallValidator.php +++ b/core/lib/Drupal/Core/Field/FieldModuleUninstallValidator.php @@ -38,6 +38,13 @@ public function __construct(EntityManagerInterface $entity_manager, TranslationI /** * {@inheritdoc} */ + public function isConfigurationBased() { + return FALSE; + } + + /** + * {@inheritdoc} + */ public function validate($module_name) { $reasons = array();