From 8a6308fc00eda7b75f8f02dacf0ca94309663598 Mon Sep 17 00:00:00 2001 From: rasstislav Date: Sun, 25 Sep 2016 14:18:47 +0200 Subject: [PATCH] Update WidgetArea.php --- code/model/WidgetArea.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/model/WidgetArea.php b/code/model/WidgetArea.php index 95a0e5c..a1ca9d3 100644 --- a/code/model/WidgetArea.php +++ b/code/model/WidgetArea.php @@ -33,10 +33,12 @@ class WidgetArea extends DataObject $items = $this->ItemsToRender(); if (!is_null($items)){ foreach ($items as $widget) { - $controller = $widget->getController(); + if ($widget->canView()) { + $controller = $widget->getController(); - $controller->init(); - $controllers->push($controller); + $controller->init(); + $controllers->push($controller); + } } } return $controllers;