Closed peterjaap closed 2 years ago
Here's a patch I used with vaimo/composer-patches;
@package smile/elasticsuite
@level 0
@link https://github.com/Smile-SA/elasticsuite/issues/2527
Subject: [PATCH] Fix for PHP 8.1 Deprecated Functionality return type mismatch
diff --git src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/QueryResponse.php src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/QueryResponse.php
index 2b59ce4..79a4554 100644
--- src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/QueryResponse.php
+++ src/module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/QueryResponse.php
@@ -64,6 +64,7 @@ class QueryResponse implements ResponseInterface
/**
* {@inheritDoc}
*/
+ #[\ReturnTypeWillChange]
public function count()
{
return $this->count;
@@ -72,6 +73,7 @@ class QueryResponse implements ResponseInterface
/**
* {@inheritDoc}
*/
+ #[\ReturnTypeWillChange]
public function getIterator()
{
return new \ArrayIterator($this->documents);
Hi, this is already fixed by those commits :
https://github.com/Smile-SA/elasticsuite/commit/80fe224f4435f387fe67b0c0b4baf6012a68f5cb
https://github.com/Smile-SA/elasticsuite/commit/6aac311f2f55d94dccbe4990f82c4e0b3af5a89b
But these commits are only on 2.10.x branch for now. We plan to release a 2.10.10 version imminently that will contain all compatibility fixes for Magento 2.4.4. You can begin using the branch right now if you do not want to wait.
Regards
@peterjaap , I tried above solutions but it's throwing error for me. Please check error message:
Tried to apply it like in command line:
git apply MAGETWO-ES-244-2022.patch error: module-elasticsuite-core/Search/Adapter/Elasticsuite/Response/QueryResponse.php: No such file or directory
location: root_project_folder\MAGETWO-ES-244-2022.patch with patch code given by you.
Please let me know any suggestion, Thanks!!
@hiteshbalpande please use Elasticsuite 2.10.10 if you are using PHP 8.1.
Regards
Elasticsuite 2.10.10
@romainruaud , I tried but it's not upgrading to smile/elasticsuite 2.10.10 version. Still it's loading with "smile/elasticsuite": "2.10.9.1" version only.
Installing ElasticSuite 2.10.9.1 using composer with the
--ignore-platform-reqs
flag got me this on a category page;