Skip to content

Commit 385c605

Browse files
committed
MC-23113: [Magento cloud] - Critical error in log: strpos() expects parameter 1 to be string, array given
1 parent 9641dfb commit 385c605

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/code/Magento/CatalogSearch/Model/Layer/Filter/Attribute.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,18 @@ public function apply(\Magento\Framework\App\RequestInterface $request)
5858
if (empty($attributeValue) && !is_numeric($attributeValue)) {
5959
return $this;
6060
}
61+
6162
$attribute = $this->getAttributeModel();
6263
/** @var \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $productCollection */
6364
$productCollection = $this->getLayer()
6465
->getProductCollection();
6566
$productCollection->addFieldToFilter($attribute->getAttributeCode(), $attributeValue);
67+
6668
$labels = [];
6769
foreach ((array) $attributeValue as $value) {
68-
$labels[] = $this->getOptionText($value);
70+
$labels[] = (array) $this->getOptionText($value);
6971
}
70-
$label = implode(',', $labels);
72+
$label = implode(',', array_unique(array_merge(...$labels)));
7173
$this->getLayer()
7274
->getState()
7375
->addFilter($this->_createItem($label, $attributeValue));

0 commit comments

Comments
 (0)