diff --git a/Model/Indexer/Page.php b/Model/Indexer/Page.php index 62cdd49b3..c2d4596a3 100755 --- a/Model/Indexer/Page.php +++ b/Model/Indexer/Page.php @@ -21,14 +21,15 @@ class Page implements Magento\Framework\Indexer\ActionInterface, Magento\Framewo private $configHelper; private $messageManager; - public function __construct(StoreManagerInterface $storeManager, - PageHelper $pageHelper, - Data $helper, - AlgoliaHelper $algoliaHelper, - Queue $queue, - ConfigHelper $configHelper, - ManagerInterface $messageManager) - { + public function __construct( + StoreManagerInterface $storeManager, + PageHelper $pageHelper, + Data $helper, + AlgoliaHelper $algoliaHelper, + Queue $queue, + ConfigHelper $configHelper, + ManagerInterface $messageManager + ) { $this->fullAction = $helper; $this->storeManager = $storeManager; $this->pageHelper = $pageHelper; @@ -56,7 +57,12 @@ public function executeFull() return; } - $storeIds = array_keys($this->storeManager->getStores()); + $storeIds = []; + foreach ($this->storeManager->getStores() as $store) { + if ($store->isActive()) { + $storeIds[] = $store->getId(); + } + } foreach ($storeIds as $storeId) { $this->queue->addToQueue($this->fullAction, 'rebuildStorePageIndex', ['store_id' => $storeId], 1);