Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit e03e9e7

Browse files
author
Volodymyr Kublytskyi
committed
Merge magento-partners/magento2ce#8.
2 parents d2d82ac + 424ad46 commit e03e9e7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,11 @@ public function reindex()
10941094
if ($this->flatState->isFlatEnabled()) {
10951095
$flatIndexer = $this->indexerRegistry->get(Indexer\Category\Flat\State::INDEXER_ID);
10961096
if (!$flatIndexer->isScheduled()) {
1097-
$flatIndexer->reindexRow($this->getId());
1097+
$idsList = [$this->getId()];
1098+
if ($this->dataHasChangedFor('url_key')) {
1099+
$idsList = array_merge($idsList, explode(',', $this->getAllChildren()));
1100+
}
1101+
$flatIndexer->reindexList($idsList);
10981102
}
10991103
}
11001104
$productIndexer = $this->indexerRegistry->get(Indexer\Category\Product::INDEXER_ID);

app/code/Magento/Catalog/Test/Unit/Model/CategoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ public function testReindexFlatEnabled($flatScheduled, $productScheduled, $expec
318318
->will($this->returnValue(true));
319319

320320
$this->flatIndexer->expects($this->exactly(1))->method('isScheduled')->will($this->returnValue($flatScheduled));
321-
$this->flatIndexer->expects($this->exactly($expectedFlatReindexCalls))->method('reindexRow')->with('123');
321+
$this->flatIndexer->expects($this->exactly($expectedFlatReindexCalls))->method('reindexList')->with(['123']);
322322

323323
$this->productIndexer->expects($this->exactly(1))->method('isScheduled')->will($this->returnValue($productScheduled));
324324
$this->productIndexer->expects($this->exactly($expectedProductReindexCall))->method('reindexList')->with($pathIds);

0 commit comments

Comments
 (0)