From b852638c1b31da62f9ab86918ac0c2a8d06af2f4 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 5 May 2014 13:56:06 -0400 Subject: Issue #2227687 by cs_shadow | Cottser: Slightly ugly error message if a module is incompatible with the version of core and the PHP version. --- modules/system/system.admin.inc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'modules/system') diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 465fd9f4d..c1e81f0bb 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -995,22 +995,28 @@ function _system_modules_build_row($info, $extra) { $status_short = ''; $status_long = ''; + // Initialize empty arrays of long and short reasons explaining why the + // module is incompatible. + // Add each reason as a separate element in both the arrays. + $reasons_short = array(); + $reasons_long = array(); + // Check the core compatibility. if (!isset($info['core']) || $info['core'] != DRUPAL_CORE_COMPATIBILITY) { $compatible = FALSE; - $status_short .= t('Incompatible with this version of Drupal core.'); - $status_long .= t('This version is not compatible with Drupal !core_version and should be replaced.', array('!core_version' => DRUPAL_CORE_COMPATIBILITY)); + $reasons_short[] = t('Incompatible with this version of Drupal core.'); + $reasons_long[] = t('This version is not compatible with Drupal !core_version and should be replaced.', array('!core_version' => DRUPAL_CORE_COMPATIBILITY)); } // Ensure this module is compatible with the currently installed version of PHP. if (version_compare(phpversion(), $info['php']) < 0) { $compatible = FALSE; - $status_short .= t('Incompatible with this version of PHP'); + $reasons_short[] = t('Incompatible with this version of PHP'); $php_required = $info['php']; if (substr_count($info['php'], '.') < 2) { $php_required .= '.*'; } - $status_long .= t('This module requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $php_required, '!php_version' => phpversion())); + $reasons_long[] = t('This module requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $php_required, '!php_version' => phpversion())); } // If this module is compatible, present a checkbox indicating @@ -1026,6 +1032,8 @@ function _system_modules_build_row($info, $extra) { } } else { + $status_short = implode(' ', $reasons_short); + $status_long = implode(' ', $reasons_long); $form['enable'] = array( '#markup' => theme('image', array('path' => 'misc/watchdog-error.png', 'alt' => $status_short, 'title' => $status_short)), ); -- cgit v1.2.3