Skip to content

Commit

Permalink
Fixed a SQL error
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Feb 7, 2024
1 parent eeb80ff commit 2e38cba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/fields/BaseRelationField.php
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,9 @@ public function normalizeValue(mixed $value, ?ElementInterface $element): mixed
CancelableEvent $event,
ElementQuery $query,
) use ($relationsAlias) {
$query->orderBy(["$relationsAlias.sortOrder" => SORT_ASC]);
if ($query->orderBy === '') {
$query->orderBy(["$relationsAlias.sortOrder" => SORT_ASC]);
}
},
]));
}
Expand Down

0 comments on commit 2e38cba

Please sign in to comment.