diff --git a/core/modules/system/lib/Drupal/system/Controller/SystemInfoController.php b/core/modules/system/lib/Drupal/system/Controller/SystemInfoController.php index 3bc83ab..b4707c3 100644 --- a/core/modules/system/lib/Drupal/system/Controller/SystemInfoController.php +++ b/core/modules/system/lib/Drupal/system/Controller/SystemInfoController.php @@ -48,6 +48,8 @@ public function __construct(ModuleHandler $module_handler) { * * @param $check * If true, only returns a boolean whether there are system status errors. + * + * @return bool|string */ public function status($check = FALSE) { // Load .install files @@ -56,7 +58,15 @@ public function status($check = FALSE) { // Check run-time requirements and status information. $requirements = $this->moduleHandler->invokeAll('requirements', array('runtime')); - usort($requirements, '_system_sort_requirements'); + usort($requirements, function($a, $b) { + if (!isset($a['weight'])) { + if (!isset($b['weight'])) { + return strcmp($a['title'], $b['title']); + } + return -$b['weight']; + } + return isset($b['weight']) ? $a['weight'] - $b['weight'] : $a['weight']; + }); if ($check) { return drupal_requirements_severity($requirements) == REQUIREMENT_ERROR; diff --git a/core/modules/system/system.module b/core/modules/system/system.module index b2d8663..294ed2d 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -3295,19 +3295,6 @@ function system_config_form_submit($form, &$form_state) { } /** - * Helper function to sort requirements. - */ -function _system_sort_requirements($a, $b) { - if (!isset($a['weight'])) { - if (!isset($b['weight'])) { - return strcmp($a['title'], $b['title']); - } - return -$b['weight']; - } - return isset($b['weight']) ? $a['weight'] - $b['weight'] : $a['weight']; -} - -/** * Generates a form array for a confirmation form. * * This function returns a complete form array for confirming an action. The