Skip to content

Commit fc328d9

Browse files
MAGETWO-94565: Catalog product collection filters produce errors and cause inconsistent behaviour
- Fix CR comments.
1 parent 2681670 commit fc328d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,8 +2108,10 @@ private function getChildrenCategories(int $categoryId): array
21082108
/** @var \Magento\Catalog\Model\ResourceModel\Category\Collection $categoryCollection */
21092109
$categoryCollection = $this->categoryCollectionFactory->create();
21102110
$categories = $categoryCollection
2111-
->addAttributeToFilter('is_anchor', 1)
2112-
->addAttributeToFilter('path', ['like' => $categoryId . '/%'])->getItems();
2111+
->addAttributeToFilter(
2112+
['is_anchor', 'path'],
2113+
[1, ['like' => $categoryId . '/%']]
2114+
)->getItems();
21132115
foreach ($categories as $category) {
21142116
$categoryChildren = $category->getChildren();
21152117
$categoryIds = array_merge($categoryIds, explode(',', $categoryChildren));

0 commit comments

Comments
 (0)