Skip to content

Commit 1357dd1

Browse files
ENGCOM-4109: Cast attribute ID to integer - Fixes #20969 #20971
- Merge Pull Request #20971 from k4emic/magento2:fix/20969 - Merged commits: 1. c5c5e41 2. 77b0ae8
2 parents 5569b86 + 77b0ae8 commit 1357dd1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Aggregation/DataProvider/SelectBuilderForAttribute.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ public function __construct(
7474
}
7575

7676
/**
77+
* Build select for attribute search
78+
*
7779
* @param Select $select
7880
* @param AbstractAttribute $attribute
7981
* @param int $currentScope
@@ -101,7 +103,7 @@ public function build(Select $select, AbstractAttribute $attribute, int $current
101103
$subSelect = $select;
102104
$subSelect->from(['main_table' => $table], ['main_table.entity_id', 'main_table.value'])
103105
->distinct()
104-
->where('main_table.attribute_id = ?', $attribute->getAttributeId())
106+
->where('main_table.attribute_id = ?', (int) $attribute->getAttributeId())
105107
->where('main_table.store_id = ? ', $currentScopeId);
106108
if ($this->isAddStockFilter()) {
107109
$subSelect = $this->applyStockConditionToSelect->execute($subSelect);
@@ -116,6 +118,8 @@ public function build(Select $select, AbstractAttribute $attribute, int $current
116118
}
117119

118120
/**
121+
* Is add stock filter
122+
*
119123
* @return bool
120124
*/
121125
private function isAddStockFilter()

0 commit comments

Comments
 (0)