apisearch-io / SyliusApisearchPlugin

:shirt: Apisearch Plugin for Sylius
4 stars 2 forks source link

Attempted to call an undefined method named "getQuery" of class "Apisearch\Result\Result #2

Open jszutkowski opened 5 years ago

jszutkowski commented 5 years ago

SyliusApisearchPlugin requires "apisearch-io/apisearch-bundle": "dev-master". And apisearch-bundle requires "apisearch-io/php-client": "dev-master"

In SyliusApisearchPlugin there is an UrlBuilder class and on line 272 it calls $result->getQuery() from php-client, however, in php-client in dev-master version there is no method getQuery but getQueryUUID

` | [24-Sep-2019 16:09:48] WARNING: [pool www] child 1711 said into stderr: "NOTICE: PHP message: PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\UndefinedMethodException: Attempted to call an undefined method named "getQuery" of class "Apisearch\Result\Result"." | [24-Sep-2019 16:09:48] WARNING: [pool www] child 1711 said into stderr: "Did you mean to call "getQueryUUID"? in /var/www/html/vendor/apisearch-io/sylius-apisearch-plugin/src/Url/UrlBuilder.php:272" | [24-Sep-2019 16:09:48] WARNING: [pool www] child 1711 said into stderr: "Stack trace:" | 127.0.0.1 - 24/Sep/2019:16:09:47 +0200 "GET /app.php" 500 | [24-Sep-2019 16:09:48] WARNING: [pool www] child 1711 said into stderr: "#0 /var/www/html/vendor/apisearch-io/sylius-apisearch-plugin/src/Url/UrlBuilder.php(174): Apisearch\SyliusApisearchPlugin\Url\UrlBuilder->generateQueryUrlParameters(Object(Apisearch\Result\Result))" | [24-Sep-2019 16:09:48] WARNING: [pool www] child 1711 said into stderr: "#1 /var/www/html/var/cache/dev/twig/94/9488b7b8bf9c970a32a42ec6045ed387d6eb88adc1399a290d873cfa2021a24f.php(338): Apisearch\SyliusApisearchPlugin\Url\UrlBuilder->removePriceRangeFilter(Object(Apisearch\Result\Result))" | [24-Sep-2019 16:09:48] WARNING: [pool www] child 1711 said into stderr: "#2 /var/www/html/var/cache/dev/twig/ee/eecbf499dfbc1c7fa1289ce99db78b79924380b135c373a29d966b0233acddcf.php(279): TwigTemplate_d73dcfb972854ff689b32eeaac8b66fe4cf07dac5cd1f4adc1f84828441fdb76->macro_printPriceRange(Object(Apisearch\Result\Result))" | [24-Sep-2019 16:09:48] WARNING: [pool www] child 1711 said into stderr: "#3 /var/www/html/..." | 2019/09/24 16:09:48 [error] 28#28: *471 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\UndefinedMethodException: Attempted to call an undefined method named "getQuery" of class "Apisearch\Result\Result". | Did you mean to call "getQueryUUID"? in /var/www/html/vendor/apisearch-io/sylius-apisearch-plugin/src/Url/UrlBuilder.php:272 | Stack trace: | #0 /var/www/html/vendor/apisearch-io/sylius-apisearch-plugin/src/Url/UrlBuilder.php(174): Apisearch\SyliusApisearchPlugin\Url\UrlBuilder->generateQueryUrlParameters(Object(Apisearch\Result\Result)) | #1 /var/www/html/var/cache/dev/twig/94/9488b7b8bf9c970a32a42ec6045ed387d6eb88adc1399a290d873cfa2021a24f.php(338): Apisearch\SyliusApisearchPlugin\Url\UrlBuilder->removePriceRangeFilter(Object(Apisearch\Result\Result)) | #2 /var/www/html/var/cache/dev/twig/ee/eecbf499dfbc1c7fa1289ce99db78b79924380b135c373a29d966b0233acddcf.php(279): TwigTemplate_d73dcfb972854ff689b32eeaac8b66fe4cf07dac5cd1f4adc1f84828441fdb76->macroprintPriceRange(Object(Apisearch\Result\Result)) | #3 /var/www/html/vendor/t" while reading response header from upstream, client: 172.26.0.1, server: , request: "GET /category/artykuly-spozywcze HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:80", referrer: "http://localhost:80/category/artykuly-spozywcze" | 172.26.0.1 - - [24/Sep/2019:16:09:48 +0200] "GET /category/artykuly-spozywcze HTTP/1.1" 500 5 "http://localhost:80/category/artykuly-spozywcze" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36" "-" 0.877 0.877 . - | 127.0.0.1 - - [24/Sep/2019:16:10:04 +0200] "GET /healthcheck HTTP/1.1" 200 12 "-" "curl/7.61.1" "-" 0.452 0.452 . - | 127.0.0.1 - 24/Sep/2019:16:10:04 +0200 "GET /app.php" 200

`

cv65kr commented 4 years ago

Thanks for reporting.

This package has dev dependecy, a lot things is changed all the times. Related issue - https://github.com/apisearch-io/php-client/issues/109

I prepare PR to this plugin to working properly with current version of Apisearch, but is still WIP. https://github.com/apisearch-io/SyliusApisearchPlugin/pull/3

Stay tuned!