From 92226d4f08d9fc1f662c83038b64cbe8617b152b Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Mon, 13 Jun 2022 09:24:25 +0200 Subject: [PATCH] DashboardList: Try to load dashlets when the current pane is empty The controller only loads dashboards/dashlets either of the given name or of the first home/pane that can be determined, so we need to load dashlets for panes that aren't active when creating the list. Otherwise, we will end up with empty dashboard panes. --- library/Icinga/Web/Dashboard/ItemList/DashboardList.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/Icinga/Web/Dashboard/ItemList/DashboardList.php b/library/Icinga/Web/Dashboard/ItemList/DashboardList.php index 8d36bb9c8..91df8de4a 100644 --- a/library/Icinga/Web/Dashboard/ItemList/DashboardList.php +++ b/library/Icinga/Web/Dashboard/ItemList/DashboardList.php @@ -23,6 +23,9 @@ class DashboardList extends ItemListControl public function __construct(Pane $pane) { $this->pane = $pane; + if (! $this->pane->hasEntries()) { + $this->pane->loadDashboardEntries(); + } $this->getAttributes() ->registerAttributeCallback('data-icinga-pane', function () {