Elasticsuite: bin/magento setup:di:compile error with magento 2.4.1

Created on 6 Oct 2020  路  6Comments  路  Source: Smile-SA/elasticsuite

Preconditions

PHP 7.4.10


Magento Version : EE 2.4.1


ElasticSuite Version : 2.10.1


Environment : Developer


Third party modules :

Steps to reproduce

  1. run bin/magento setup:di:compile

Expected result

no errors

Actual result

PHP Fatal error:  Declaration of Smile\ElasticsuiteCatalogGraphQl\Model\Resolver\Products\Query\Search::getResult(array $args, Magento\Framework\GraphQl\Schema\Type\ResolveInfo $info): Magento\CatalogGraphQl\Model\Resolver\Products\SearchResult must be compatible with Magento\CatalogGraphQl\Model\Resolver\Products\Query\ProductQueryInterface::getResult(array $args, Magento\Framework\GraphQl\Schema\Type\ResolveInfo $info, Magento\GraphQl\Model\Query\ContextInterface $context): Magento\CatalogGraphQl\Model\Resolver\Products\SearchResult in /magentoRoot/vendor/smile/elasticsuite/src/module-elasticsuite-catalog-graph-ql/Model/Resolver/Products/Query/Search.php on line 85
bug

Most helpful comment

@leonhelmus
i resolved it with patch:

--- a/src/module-elasticsuite-catalog-graph-ql/Model/Resolver/Products/Query/Search.php
+++ b/src/module-elasticsuite-catalog-graph-ql/Model/Resolver/Products/Query/Search.php
@@ -82,7 +82,7 @@ class Search implements ProductQueryInterface
     /**
      * {@inheritDoc}
      */
-    public function getResult(array $args, ResolveInfo $info/*, ContextInterface $context*/): SearchResult
+    public function getResult(array $args, ResolveInfo $info, ContextInterface $context): SearchResult
     {
         $queryFields    = $this->fieldSelection->getProductsFieldSelection($info);
         $searchCriteria = $this->buildSearchCriteria($args, $info);

All 6 comments

I have the same problem. Can this be resolved :).

@leonhelmus
i resolved it with patch:

--- a/src/module-elasticsuite-catalog-graph-ql/Model/Resolver/Products/Query/Search.php
+++ b/src/module-elasticsuite-catalog-graph-ql/Model/Resolver/Products/Query/Search.php
@@ -82,7 +82,7 @@ class Search implements ProductQueryInterface
     /**
      * {@inheritDoc}
      */
-    public function getResult(array $args, ResolveInfo $info/*, ContextInterface $context*/): SearchResult
+    public function getResult(array $args, ResolveInfo $info, ContextInterface $context): SearchResult
     {
         $queryFields    = $this->fieldSelection->getProductsFieldSelection($info);
         $searchCriteria = $this->buildSearchCriteria($args, $info);

@romainruaud is there an ETA of when we can expect official M2.4.1 support? We need to update soon.

+1 for update ... we need this update too if possible ... thx

Now we have a problem with 2.4.0 and smile/elasticsearch 2.10.2 ;-)
I fixed my shop with 2.4.0 with version a fixed 2.10.1, that resolves the issue.
But not a nice solution :-(

I had same issue and had to edit composer.json to use 2.10.1 instead of ^2.10.

Was this page helpful?
0 / 5 - 0 ratings