From a3a6fec896280eda273086068e20a845cdd5d4a1 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Thu, 20 Jun 2024 16:41:25 -0400 Subject: [PATCH] fix: Fixed an issue where `toArray()` was done recursively on the passed in `$critera`, which turned objects into sub-arrays in `orderBy` and other properties, causing a DB error ([#51](https://github.com/nystudio107/craft-similar/issues/51)) ([#50](https://github.com/nystudio107/craft-similar/issues/50)) --- src/services/Similar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/Similar.php b/src/services/Similar.php index 2aa8a35..019478b 100644 --- a/src/services/Similar.php +++ b/src/services/Similar.php @@ -76,7 +76,7 @@ public function find(array $data): array|ElementInterface if (is_object($criteria)) { /** @var ElementQueryInterface $criteria */ - $criteria = $criteria->toArray(); + $criteria = $criteria->toArray([], [], false); } // Get an ElementQuery for this Element