Skip to content

Commit

Permalink
Prevent cache clean plugin to be triggered in case the is_virtual_cat…
Browse files Browse the repository at this point in the history
…egory attribute is not existing.
  • Loading branch information
romainruaud committed Nov 21, 2018
1 parent c1cb85f commit 8d4a1e2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ public function afterExecuteFull(\Magento\CatalogSearch\Model\Indexer\Fulltext $
{
/** @var \Magento\Catalog\Model\ResourceModel\Category\Collection $categories */
$categories = $this->categoryCollectionFactory->create();

// Can occur during setup:install.
if (false === $categories->getEntity()->getAttribute('is_virtual_category')) {
return;
}

$categories->addAttributeToSelect(['is_virtual_category'])
->addIsActiveFilter()
->addAttributeToFilter('is_virtual_category', 1);
Expand Down

0 comments on commit 8d4a1e2

Please sign in to comment.