Skip to content

Commit

Permalink
Merge branch 'release/5.0.2' into v5
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Jun 20, 2024
2 parents 0ac24c0 + 260d263 commit 3a88639
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Similar Changelog

## 5.0.2 - 2024.06.20
### Fixed
* 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))

## 5.0.1 - 2024.06.19
### Fixed
* Filter out `OrderByPlaceholderExpression` expressions from the `orderBy` clause in the `ElementQuery` to prevent invalid SQL from being generated ([#51](https://github.com/nystudio107/craft-similar/issues/51)) ([#52](https://github.com/nystudio107/craft-similar/issues/52))
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nystudio107/craft-similar",
"description": "Similar for Craft lets you find elements, Entries, Categories, Commerce Products, etc, that are similar, based on... other related elements.",
"type": "craft-plugin",
"version": "5.0.1",
"version": "5.0.2",
"keywords": [
"craft",
"cms",
Expand Down
2 changes: 1 addition & 1 deletion src/services/Similar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a88639

Please sign in to comment.