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

Commit 1a25390

Browse files
committed
[TASK] Changed logic so only reindexList function is called
1 parent 42b5db5 commit 1a25390

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,10 +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()];
10981098
if ($this->dataHasChangedFor('url_key')) {
1099-
$flatIndexer->reindexList(explode(',', $this->getAllChildren()));
1099+
$idsList = array_merge($idsList, explode(',', $this->getAllChildren()));
11001100
}
1101+
$flatIndexer->reindexList($idsList);
11011102
}
11021103
}
11031104
$productIndexer = $this->indexerRegistry->get(Indexer\Category\Product::INDEXER_ID);

0 commit comments

Comments
 (0)