Commit 8dd0e326 authored by catch's avatar catch

Issue #3156882 by alexpott, johnwebdev, adityasingh, pfrenssen:...

Issue #3156882 by alexpott, johnwebdev, adityasingh, pfrenssen: \Drupal\Core\Render\Element\StatusReport::preRenderGroupRequirements() and \Drupal\user\PermissionHandler::sortPermissions() sorts return bools

(cherry picked from commit edea7833)
parent 64344760
......@@ -52,7 +52,7 @@ public static function preRenderGroupRequirements($element) {
// Order the grouped requirements by a set order.
$order = array_flip($element['#priorities']);
uksort($grouped_requirements, function ($a, $b) use ($order) {
return $order[$a] > $order[$b];
return $order[$a] <=> $order[$b];
});
$element['#grouped_requirements'] = $grouped_requirements;
......
......@@ -205,10 +205,10 @@ protected function sortPermissions(array $all_permissions = []) {
uasort($all_permissions, function (array $permission_a, array $permission_b) use ($modules) {
if ($modules[$permission_a['provider']] == $modules[$permission_b['provider']]) {
return $permission_a['title'] > $permission_b['title'];
return $permission_a['title'] <=> $permission_b['title'];
}
else {
return $modules[$permission_a['provider']] > $modules[$permission_b['provider']];
return $modules[$permission_a['provider']] <=> $modules[$permission_b['provider']];
}
});
return $all_permissions;
......
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