From b7f9e6d3b1fbc15637479ed115989f96d8a903ea Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Mon, 9 May 2022 13:36:33 -0400 Subject: [PATCH 1/3] fix: Fixed an issue where passing an `ElementQuery` into `criteria` would cause it to throw a type error ([#44](https://github.com/nystudio107/craft-similar/issues/44)) --- 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 6bc91b0..f043dc3 100644 --- a/src/services/Similar.php +++ b/src/services/Similar.php @@ -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)); } From f61395059e75459707ae5d9f2de8e1d01b91e858 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Mon, 9 May 2022 13:37:32 -0400 Subject: [PATCH 2/3] chore: Copyright date --- LICENSE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 6fb4571..2796c49 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,9 +1,9 @@ The MIT License (MIT) -Copyright (c) 2018 nystudio107.com +Copyright (c) 2022 nystudio107.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From 0238fa686344e308877a0c28143ca294422350b9 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Mon, 9 May 2022 13:37:47 -0400 Subject: [PATCH 3/3] chore: Version 4.0.0 --- CHANGELOG.md | 7 +++++++ composer.json | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9c72b8..4fc8b4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Similar Changelog +## 4.0.0 - 2022.05.09 +### Added +* Initial Craft CMS 4 release + +### Fixed +* Fixed an issue where passing an `ElementQuery` into `criteria` would cause it to throw a type error ([#44](https://github.com/nystudio107/craft-similar/issues/44)) + ## 4.0.0-beta.1 - 2022.03.15 ### Added diff --git a/composer.json b/composer.json index aa93a49..ae35fac 100644 --- a/composer.json +++ b/composer.json @@ -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": "4.0.0-beta.1", + "version": "4.0.0", "keywords": [ "craft", "cms", @@ -25,7 +25,7 @@ } ], "require": { - "craftcms/cms": "^4.0.0-beta.1" + "craftcms/cms": "^4.0.0" }, "autoload": { "psr-4": {