From dc6b472ec9fe19539e00479302c224eae849353a Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 12 Mar 2015 18:47:34 +0100 Subject: [PATCH] Don't create search dashlets if the search string is empty refs #8668 --- library/Icinga/Web/Widget/SearchDashboard.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/library/Icinga/Web/Widget/SearchDashboard.php b/library/Icinga/Web/Widget/SearchDashboard.php index 537963b98..d81d184cf 100644 --- a/library/Icinga/Web/Widget/SearchDashboard.php +++ b/library/Icinga/Web/Widget/SearchDashboard.php @@ -60,6 +60,10 @@ class SearchDashboard extends Dashboard foreach ($manager->getLoadedModules() as $module) { $moduleSearchUrls = $module->getSearchUrls(); if (! empty($moduleSearchUrls)) { + if ($searchString === '') { + $pane->add(t('Ready to search'), 'search/hint'); + return; + } $searchUrls = array_merge($searchUrls, $moduleSearchUrls); } } @@ -72,12 +76,6 @@ class SearchDashboard extends Dashboard Url::fromPath($searchUrl->url, array('q' => $searchString)) ); } - - if ($searchString === '' && $pane->hasDashlets()) { - $pane->removeDashlets(); - $pane->add('Ready to search', 'search/hint'); - return; - } } /**