Skip to content
Snippets Groups Projects
Commit 14aad562 authored by Oleksii Korshenko's avatar Oleksii Korshenko
Browse files

MAGETWO-85634: magento/magento2#12667: Incorrect partial attribute (EAV)...

MAGETWO-85634: magento/magento2#12667: Incorrect partial attribute (EAV) reindex (Update by Schedule) for configurable product with childs visibility 'Not Visible Individually' #1023

 - Merge Pull Request magento-engcom/magento2ce#1023 from RomaKis/magento2:12667
 - Merged commits:
   1. 585803ac
parents 3839c0fc 585803ac
No related merge requests found
...@@ -143,6 +143,7 @@ abstract class AbstractAction ...@@ -143,6 +143,7 @@ abstract class AbstractAction
protected function processRelations($indexer, $ids, $onlyParents = false) protected function processRelations($indexer, $ids, $onlyParents = false)
{ {
$parentIds = $indexer->getRelationsByChild($ids); $parentIds = $indexer->getRelationsByChild($ids);
$parentIds = array_unique(array_merge($parentIds, $ids));
$childIds = $onlyParents ? [] : $indexer->getRelationsByParent($parentIds); $childIds = $onlyParents ? [] : $indexer->getRelationsByParent($parentIds);
return array_unique(array_merge($ids, $childIds, $parentIds)); return array_unique(array_merge($ids, $childIds, $parentIds));
} }
......
...@@ -129,8 +129,9 @@ class AbstractActionTest extends \PHPUnit\Framework\TestCase ...@@ -129,8 +129,9 @@ class AbstractActionTest extends \PHPUnit\Framework\TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$eavSource->expects($this->once())->method('getRelationsByChild')->with($childIds)->willReturn($childIds); $eavSource->expects($this->once())->method('getRelationsByChild')->with($childIds)->willReturn($parentIds);
$eavSource->expects($this->once())->method('getRelationsByParent')->with($childIds)->willReturn($parentIds); $eavSource->expects($this->once())->method('getRelationsByParent')
->with(array_unique(array_merge($parentIds, $childIds)))->willReturn($parentIds);
$eavDecimal->expects($this->once())->method('getRelationsByChild')->with($reindexIds)->willReturn($reindexIds); $eavDecimal->expects($this->once())->method('getRelationsByChild')->with($reindexIds)->willReturn($reindexIds);
$eavDecimal->expects($this->once())->method('getRelationsByParent')->with($reindexIds)->willReturn([]); $eavDecimal->expects($this->once())->method('getRelationsByParent')->with($reindexIds)->willReturn([]);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment