diff -u b/core/modules/system/src/Form/ModulesUninstallForm.php b/core/modules/system/src/Form/ModulesUninstallForm.php --- b/core/modules/system/src/Form/ModulesUninstallForm.php +++ b/core/modules/system/src/Form/ModulesUninstallForm.php @@ -143,11 +143,10 @@ $form['uninstall'][$module->getName()]['#disabled'] = TRUE; } // All modules which depend on this one must be uninstalled first, before - // we can allow this module to be uninstalled. (The installation profile - // is excluded from this list.) - $dependents = array_diff_key($module->required_by, $profiles); - foreach (array_keys($dependents) as $dependent) { - if (drupal_get_installed_schema_version($dependent) != SCHEMA_UNINSTALLED) { + // we can allow this module to be uninstalled. (Installation profiles are + // excluded from this list.) + foreach (array_keys($module->required_by) as $dependent) { + if (!in_array($dependent, array_keys($profiles)) && drupal_get_installed_schema_version($dependent) != SCHEMA_UNINSTALLED) { $name = isset($modules[$dependent]->info['name']) ? $modules[$dependent]->info['name'] : $dependent; $form['modules'][$module->getName()]['#required_by'][] = $name; $form['uninstall'][$module->getName()]['#disabled'] = TRUE;