Skip to content

Commit cb732af

Browse files
author
Oleksii Korshenko
authored
MAGETWO-85634: magento#12667: Incorrect partial attribute (EAV) reindex (Update by Schedule) for configurable product with childs visibility "Not Visible Individually" magento#1023
2 parents ea58fee + 14aad56 commit cb732af

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/code/Magento/Catalog/Model/Indexer/Product/Eav/AbstractAction.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ protected function syncData($indexer, $destinationTable, $ids)
143143
protected function processRelations($indexer, $ids, $onlyParents = false)
144144
{
145145
$parentIds = $indexer->getRelationsByChild($ids);
146+
$parentIds = array_unique(array_merge($parentIds, $ids));
146147
$childIds = $onlyParents ? [] : $indexer->getRelationsByParent($parentIds);
147148
return array_unique(array_merge($ids, $childIds, $parentIds));
148149
}

app/code/Magento/Catalog/Test/Unit/Model/Indexer/Product/Eav/AbstractActionTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ public function testReindexWithNotNullArgumentExecutesReindexEntities()
129129
->disableOriginalConstructor()
130130
->getMock();
131131

132-
$eavSource->expects($this->once())->method('getRelationsByChild')->with($childIds)->willReturn($childIds);
133-
$eavSource->expects($this->once())->method('getRelationsByParent')->with($childIds)->willReturn($parentIds);
132+
$eavSource->expects($this->once())->method('getRelationsByChild')->with($childIds)->willReturn($parentIds);
133+
$eavSource->expects($this->once())->method('getRelationsByParent')
134+
->with(array_unique(array_merge($parentIds, $childIds)))->willReturn($parentIds);
134135

135136
$eavDecimal->expects($this->once())->method('getRelationsByChild')->with($reindexIds)->willReturn($reindexIds);
136137
$eavDecimal->expects($this->once())->method('getRelationsByParent')->with($reindexIds)->willReturn([]);

0 commit comments

Comments
 (0)