From d06ce98d2f766097148c4ba5fc488bb6476b540d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 13 Aug 2024 11:36:31 +0200 Subject: [PATCH 1/2] IniWriter: Avoid deprecation notice upon write errors --- library/Icinga/File/Ini/IniWriter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/File/Ini/IniWriter.php b/library/Icinga/File/Ini/IniWriter.php index 1f470b006a..2131bc8825 100644 --- a/library/Icinga/File/Ini/IniWriter.php +++ b/library/Icinga/File/Ini/IniWriter.php @@ -69,7 +69,7 @@ public function __construct(Config $config, $filename, $filemode = 0660, $option */ public function render() { - if (file_exists($this->filename)) { + if ($this->filename !== null && file_exists($this->filename)) { $oldconfig = Config::fromIni($this->filename); $content = trim(file_get_contents($this->filename)); } else { From 81a3be74f35e106b7e7c200d37f000d0b4e8b114 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 13 Aug 2024 11:37:12 +0200 Subject: [PATCH 2/2] Dashboard: Don't merge already existing dashlets fixes #5203 --- library/Icinga/Web/Widget/Dashboard.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/library/Icinga/Web/Widget/Dashboard.php b/library/Icinga/Web/Widget/Dashboard.php index 5a8796d279..4aa84c7ca4 100644 --- a/library/Icinga/Web/Widget/Dashboard.php +++ b/library/Icinga/Web/Widget/Dashboard.php @@ -147,15 +147,17 @@ protected function loadUserDashboardsFromFile($file, Navigation $dashboardNaviga if ($dashboardPane !== null) { $key = $dashboardPane->getLabel(); } + $pane = null; if ($this->hasPane($key)) { - $panes[$key] = $this->getPane($key); + $pane = $this->getPane($key); } else { - $panes[$key] = new Pane($key); + $pane = new Pane($key); + $panes[$key] = $pane; $panes[$key]->setTitle($part->title); } - $panes[$key]->setUserWidget(); + $pane->setUserWidget(); if ((bool) $part->get('disabled', false) === true) { - $panes[$key]->setDisabled(); + $pane->setDisabled(); } } else { list($paneName, $dashletName) = explode('.', $key, 2);