From c8d4a436a8fc479aff194a8c061a823adce99147 Mon Sep 17 00:00:00 2001 From: sebalis Date: Sat, 5 Nov 2022 00:54:14 +0100 Subject: [PATCH] avoid fatal error in PHP 8 in BAO/Navigation.php See https://lab.civicrm.org/dev/core/-/issues/3968 for details. --- CRM/Core/BAO/Navigation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Core/BAO/Navigation.php b/CRM/Core/BAO/Navigation.php index e772db9a38bf..4651c710b68b 100644 --- a/CRM/Core/BAO/Navigation.php +++ b/CRM/Core/BAO/Navigation.php @@ -320,7 +320,7 @@ public static function orderByWeight(&$navigations) { if (!isset($b['attributes']['weight'])) { $b['attributes']['weight'] = 1000; } - return $a['attributes']['weight'] - $b['attributes']['weight']; + return (int) $a['attributes']['weight'] - (int) $b['attributes']['weight']; }); // If any of the $navigations have children, recurse