Don't create search dashlets if the search string is empty

refs #8668
This commit is contained in:
Eric Lippmann 2015-03-12 18:47:34 +01:00
parent 515fe3249f
commit dc6b472ec9
1 changed files with 4 additions and 6 deletions

View File

@ -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;
}
}
/**