Skip to content

Commit

Permalink
Merge pull request #48 from romainruaud/fix_category-indexing
Browse files Browse the repository at this point in the history
Fix category indexing
  • Loading branch information
afoucret committed Jun 6, 2016
2 parents abeefc4 + 89d22f2 commit fdc5d2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ public function aroundReindex(
) {
$proceed();

$categoryIndexer = $this->indexerRegistry->get(\Smile\ElasticSuiteCatalog\Model\Category\Indexer\Fulltext::INDEXER_ID);

$categoryIndexer->reindexRow($subject->getId());
if ($subject->getLevel() > 1) {
$categoryIndexer = $this->indexerRegistry->get(\Smile\ElasticSuiteCatalog\Model\Category\Indexer\Fulltext::INDEXER_ID);
$categoryIndexer->reindexRow($subject->getId());
}

return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function aroundSave(
\Closure $proceed,
\Magento\Framework\Model\AbstractModel $category
) {
if ($category->getSortedProducts()) {
if ($category->getId() && $category->getSortedProducts()) {
$this->unserializeProductPositions($category);

$categoryResource->addCommitCallback(
Expand Down

0 comments on commit fdc5d2a

Please sign in to comment.