Skip to content

Commit

Permalink
fix: Fixed an issue where passing an ElementQuery into criteria w…
Browse files Browse the repository at this point in the history
…ould cause it to throw a type error ([#44](#44))
  • Loading branch information
Andrew Welch committed May 9, 2022
1 parent 80fa365 commit b7f9e6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/Similar.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function find(array $data): array|ElementInterface
}
}

if (empty($data['criteria']['orderBy'])) {
if (empty($criteria['orderBy'])) {
usort($elements, static fn($a, $b) => $a->count < $b->count ? 1 : ($a->count == $b->count ? 0 : -1));
}

Expand Down

0 comments on commit b7f9e6d

Please sign in to comment.