-
Notifications
You must be signed in to change notification settings - Fork 351
Open
Description
Preconditions
Magento Version : Magento 2.4.7-p4
ElasticSuite Version : 2.11.13
Environment : both
Third party modules :
Steps to reproduce
- Add color swatch and enable filtering
- Have some products with custom images for swatches, and some without swatch variant image
- Filter by few colours
Expected result
- Filtering works
Actual result
Exception #0 (Exception): Warning: Array to string conversion in /var/www/html/vendor/magento/module-swatches/Helper/Data.php on line 200
<pre>#1 array_diff_assoc() called at [vendor/magento/module-swatches/Helper/Data.php:200]
#2 Magento\Swatches\Helper\Data->loadFirstVariation() called at [vendor/magento/module-swatches/Helper/Data.php:232]
#3 Magento\Swatches\Helper\Data->loadFirstVariationWithImage() called at [vendor/smile/elasticsuite/src/module-elasticsuite-swatches/Model/Plugin/ProductImage.php:101]
#4 Smile\ElasticsuiteSwatches\Model\Plugin\ProductImage->loadSimpleVariation() called at [vendor/smile/elasticsuite/src/module-elasticsuite-swatches/Model/Plugin/ProductImage.php:47]
#5 Smile\ElasticsuiteSwatches\Model\Plugin\ProductImage->beforeGetImage() called at [vendor/magento/framework/Interception/Interceptor.php:121]
#6 Magento\Catalog\Block\Product\ListProduct\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#7 Magento\Catalog\Block\Product\ListProduct\Interceptor->___callPlugins() called at [generated/code/Magento/Catalog/Block/Product/ListProduct/Interceptor.php:329]
I've looked into where array comes to in first place and I've found that in src/vendor/smile/elasticsuite/src/module-elasticsuite-swatches/Model/Plugin/ProductImage.php:79 there is condition that adds option ids to array, which becomes a bit of a mixture of labels and ids.
Below screenshot of 2 debugging dump lines added after line 80
$filterArray[$code][] = $this->swatchHelperData->getOptionIds($attribute, $value);
dump($filterArray);
dump($this->swatchHelperData->getOptionIds($attribute, $value));
Metadata
Metadata
Assignees
Labels
No labels
