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;