From 6b3bf49ae7230cfb882ea00ef1f39563a62ed8d6 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Fri, 22 Nov 2024 10:43:49 -0800 Subject: [PATCH] PHP didn't support unpacking associative arrays until 8.1 --- src/base/Element.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/base/Element.php b/src/base/Element.php index 7b6a66668a8..757b7c08d62 100644 --- a/src/base/Element.php +++ b/src/base/Element.php @@ -1260,10 +1260,9 @@ public static function sortOptions(): array $sortOptions = static::defineSortOptions(); // Make sure ID is listed first - $sortOptions = [ + $sortOptions = array_merge([ 'id' => Craft::t('app', 'ID'), - ...ArrayHelper::without($sortOptions, 'id'), - ]; + ], ArrayHelper::without($sortOptions, 'id')); // Give plugins a chance to modify them $event = new RegisterElementSortOptionsEvent([