Commit 9442bea3 authored by webchick's avatar webchick

Issue #2227687 by cs_shadow, Cottser: Slightly ugly error message if a module...

Issue #2227687 by cs_shadow, Cottser: Slightly ugly error message if a module is incompatible with the version of core and the PHP version.
parent f923acdb
......@@ -263,12 +263,15 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
// Check the compatibilities.
$compatible = TRUE;
$status = '';
// Initialize an empty array of reasons why the module is incompatible. Add
// each reason as a separate element of the array.
$reasons = array();
// Check the core compatibility.
if ($module->info['core'] != \Drupal::CORE_COMPATIBILITY) {
$compatible = FALSE;
$status .= $this->t('This version is not compatible with Drupal !core_version and should be replaced.', array(
$reasons[] = $this->t('This version is not compatible with Drupal !core_version and should be replaced.', array(
'!core_version' => \Drupal::CORE_COMPATIBILITY,
));
}
......@@ -277,7 +280,7 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
if (version_compare(phpversion(), $module->info['php']) < 0) {
$compatible = FALSE;
$required = $module->info['php'] . (substr_count($module->info['php'], '.') < 2 ? '.*' : '');
$status .= $this->t('This module requires PHP version @php_required and is incompatible with PHP version !php_version.', array(
$reasons[] = $this->t('This module requires PHP version @php_required and is incompatible with PHP version !php_version.', array(
'@php_required' => $required,
'!php_version' => phpversion(),
));
......@@ -285,6 +288,7 @@ protected function buildRow(array $modules, Extension $module, $distribution) {
// If this module is not compatible, disable the checkbox.
if (!$compatible) {
$status = implode(' ', $reasons);
$row['enable']['#disabled'] = TRUE;
$row['description'] = array(
'#theme' => 'system_modules_incompatible',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment