From 3fc98cc1fef787bbb58fba0e0528be5d8365ae88 Mon Sep 17 00:00:00 2001 From: PromInc Date: Tue, 27 Aug 2024 11:14:22 -0500 Subject: [PATCH] Update Configuration.php typecast the $query variable to comply with the PHP 8 standards of [html_entity_decode](https://www.php.net/manual/en/function.html-entity-decode.php) If the search results page (`/catalogsearch/result`) is requested and the `q` query parameter is not present the page will error. The code errors when generating the `algoliaConfig` JS variable which means that Algolia can not be instantiated. This means no products show on the page - the expected result is that a blank search query would be performed and thus a set of products would be displayed. --- Block/Configuration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Block/Configuration.php b/Block/Configuration.php index 78fba81b8..c54c943aa 100755 --- a/Block/Configuration.php +++ b/Block/Configuration.php @@ -269,7 +269,7 @@ public function getConfiguration() 'autofocus' => true, 'resultPageUrl' => $this->getCatalogSearchHelper()->getResultUrl(), 'request' => [ - 'query' => htmlspecialchars(html_entity_decode($query)), + 'query' => htmlspecialchars(html_entity_decode((string)$query)), 'refinementKey' => $refinementKey, 'refinementValue' => $refinementValue, 'categoryId' => $categoryId,