Skip to content

Commit 882bbae

Browse files
MAGETWO-94565: Catalog product collection filters produce errors and cause inconsistent behaviour
- Change fetchRow to fetchOne.
1 parent 5f7231c commit 882bbae

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Category.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,14 +1148,13 @@ public function getCategoryWithChildren(int $categoryId): array
11481148
{
11491149
$connection = $this->getConnection();
11501150

1151-
$select = $connection->select()
1151+
$selectAttributeCode = $connection->select()
11521152
->from(
11531153
['eav_attribute' => $this->getTable('eav_attribute')],
11541154
['attribute_id']
11551155
)->where('entity_type_id = ?', CategorySetup::CATEGORY_ENTITY_TYPE_ID)
11561156
->where('attribute_code = ?', 'is_anchor')
11571157
->limit(1);
1158-
$attributeId = $connection->fetchRow($select);
11591158

11601159
$select = $connection->select()
11611160
->from(
@@ -1167,7 +1166,7 @@ public function getCategoryWithChildren(int $categoryId): array
11671166
['is_anchor' => 'cce_int.value']
11681167
)->where(
11691168
'cce_int.attribute_id = ?',
1170-
$attributeId['attribute_id']
1169+
$connection->fetchOne($selectAttributeCode)
11711170
)->where(
11721171
"cce.path LIKE '%/{$categoryId}' OR cce.path LIKE '%/{$categoryId}/%'"
11731172
)->order('path');

0 commit comments

Comments
 (0)