Skip to content

Commit

Permalink
Fix #39 by always trying to index pages on save, even if non searchable.
Browse files Browse the repository at this point in the history
  • Loading branch information
romainruaud committed Jun 5, 2024
1 parent a7995f4 commit f25e3c8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Plugin/Indexer/Page/Save/ReindexPageAfterSave.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@ public function afterSave(
\Magento\Framework\Model\ResourceModel\Db\AbstractDb $result,
\Magento\Framework\Model\AbstractModel $page
) {
if ($page->getIsSearchable()) {
$cmsPageIndexer = $this->indexerRegistry->get(Fulltext::INDEXER_ID);
if (!$cmsPageIndexer->isScheduled()) {
$cmsPageIndexer->reindexRow($page->getId());
}
$cmsPageIndexer = $this->indexerRegistry->get(Fulltext::INDEXER_ID);
if (!$cmsPageIndexer->isScheduled()) {
$cmsPageIndexer->reindexRow($page->getId());
}

return $result;
Expand Down

0 comments on commit f25e3c8

Please sign in to comment.