diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php index b9e5724..62e09c2 100644 --- a/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -810,13 +810,20 @@ public function uninstall($module_list = array(), $uninstall_dependents = TRUE) $module_list = array_keys($module_list); } + // Modules must be enabled before they are uninstalled. + $this->enable($module_list, FALSE); + $schema_store = \Drupal::keyValue('system.schema'); + $module_config = \Drupal::config('system.module'); $disabled_config = \Drupal::config('system.module.disabled'); foreach ($module_list as $module) { // Uninstall the module. module_load_install($module); $this->invoke($module, 'uninstall'); drupal_uninstall_schema($module); + $module_config + ->clear("enabled.$module") + ->save(); // Remove all configuration belonging to the module. config_uninstall_default_config('module', $module);