diff --git a/core/modules/system/src/Form/ModulesUninstallForm.php b/core/modules/system/src/Form/ModulesUninstallForm.php index 360dbf9..ec1a0ea 100644 --- a/core/modules/system/src/Form/ModulesUninstallForm.php +++ b/core/modules/system/src/Form/ModulesUninstallForm.php @@ -149,7 +149,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { // If a validator returns reasons not to uninstall a module, // list the reasons and disable the check box. if (isset($validation_reasons[$module_key])) { - $form['modules'][$module->getName()]['#validation_reasons'] = $validation_reasons[$module_key]; $form['uninstall'][$module->getName()]['#disabled'] = TRUE; } // All modules which depend on this one must be uninstalled first, before @@ -173,6 +172,14 @@ public function buildForm(array $form, FormStateInterface $form_state) { else { $disabled_message = ''; } + if (isset($validation_reasons[$module_key])) { + $disabled_message = \Drupal::translation()->formatPlural(count($validation_reasons[$module_key]), + 'The following reason prevents @module from being uninstalled: @reasons', + 'The following reasons prevents @module from being uninstalled: @reasons', + array('@module' => $module->getName(), '@reasons' => implode('; ', $validation_reasons[$module_key]))); + $disabled_message .= '