Skip to content

Commit

Permalink
PHP didn't support unpacking associative arrays until 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Nov 22, 2024
1 parent bce2bdc commit 6b3bf49
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/base/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down

0 comments on commit 6b3bf49

Please sign in to comment.