From 7ac135d413b02866aa4f4f3d67df874125aa2247 Mon Sep 17 00:00:00 2001 From: Raul E Watson Date: Tue, 13 Feb 2018 10:00:20 +0000 Subject: [PATCH] Prevent inactive blocks to be rendered --- Block/Html/TopMenu.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Block/Html/TopMenu.php b/Block/Html/TopMenu.php index 03e18e7..e744910 100644 --- a/Block/Html/TopMenu.php +++ b/Block/Html/TopMenu.php @@ -94,8 +94,11 @@ public function getCategoryUrl($category) */ public function getCmsMenu($category) { + $block = null; $blockId = $category->getData('cms_block_menu'); - - return $blockId ? $this->blockRepository->getById($blockId)->getContent() : null; + if ($blockId) { + $block = $this->blockRepository->getById($blockId); + } + return ($block && $block->getData('is_active')) ? $block->getContent() : null; } }