diff --git a/core/modules/system/src/Form/ModulesListForm.php b/core/modules/system/src/Form/ModulesListForm.php index 28ff7ef..6f089ba 100644 --- a/core/modules/system/src/Form/ModulesListForm.php +++ b/core/modules/system/src/Form/ModulesListForm.php @@ -261,6 +261,11 @@ protected function buildRow(array $modules, Extension $module, $distribution) { // Used when displaying modules that are required by the installation profile $row['enable']['#disabled'] = TRUE; $row['#required_by'][] = $distribution . (!empty($module->info['explanation']) ? ' (' . $module->info['explanation'] . ')' : ''); + $row['enable']['#attributes']['title'] = $this->t("@module required by @distribution", + [ + '@module' => $module->info['name'], + '@distribution' => $distribution, + ]); } // Check the compatibilities. @@ -294,6 +299,11 @@ protected function buildRow(array $modules, Extension $module, $distribution) { $row['enable']['#disabled'] = TRUE; $row['description']['#markup'] = $status; $row['#attributes']['class'][] = 'incompatible'; + $row['enable']['#attributes']['title'] = $this->t("@module is incompatible. @reasons", + [ + '@module' => $module->info['name'], + '@reasons' => $status, + ]); } // If this module requires other modules, add them to the array. @@ -301,6 +311,7 @@ protected function buildRow(array $modules, Extension $module, $distribution) { if (!isset($modules[$dependency])) { $row['#requires'][$dependency] = $this->t('@module (missing)', ['@module' => Unicode::ucfirst($dependency)]); $row['enable']['#disabled'] = TRUE; + $row['enable']['#attributes']['title'] = $this->t("@module missing", ['@module' => Unicode::ucfirst($dependency)]); } // Only display visible modules. elseif (empty($modules[$dependency]->hidden)) { @@ -313,6 +324,11 @@ protected function buildRow(array $modules, Extension $module, $distribution) { '@version' => $modules[$dependency]->info['version'], ]); $row['enable']['#disabled'] = TRUE; + $row['enable']['#attributes']['title'] = $this->t("@module is incompatible with version @version", + [ + '@module' => $name . $incompatible_version, + '@version' => $modules[$dependency]->info['version'], + ]); } // Disable the checkbox if the dependency is incompatible with this // version of Drupal core. @@ -321,6 +337,7 @@ protected function buildRow(array $modules, Extension $module, $distribution) { '@module' => $name, ]); $row['enable']['#disabled'] = TRUE; + $row['enable']['#attributes']['title'] = $this->t("@module is incompatible with this version of Drupal core", ['@module' => $name]); } elseif ($modules[$dependency]->status) { $row['#requires'][$dependency] = $this->t('@module', ['@module' => $name]); @@ -338,6 +355,11 @@ protected function buildRow(array $modules, Extension $module, $distribution) { if ($modules[$dependent]->status == 1 && $module->status == 1) { $row['#required_by'][$dependent] = $this->t('@module', ['@module' => $modules[$dependent]->info['name']]); $row['enable']['#disabled'] = TRUE; + $row['enable']['#attributes']['title'] = $this->t("@module is required by @dependency", + [ + '@module' => $module->info['name'], + '@dependency' => $modules[$dependent]->info['name'], + ]); } else { $row['#required_by'][$dependent] = $this->t('@module (disabled)', ['@module' => $modules[$dependent]->info['name']]); @@ -345,6 +367,12 @@ protected function buildRow(array $modules, Extension $module, $distribution) { } } + // If the row checkbox is disabled and there is no hover state, direct user + // to the uninstall page. + if ($row['enable']['#disabled'] && empty($row['enable']['#attributes']['title'])) { + $row['enable']['#attributes']['title'] = $this->t('@module is enabled and can be disabled from the `Uninstall` tab', ['@module' => $module->info['name']]); + } + return $row; }