From 0d35a1774d6425b2787b799549243802d61f693c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 7 Apr 2021 15:59:03 +0200 Subject: [PATCH] SingleValueSearchControl: Add failure message for empty results --- library/Icinga/Web/Widget/SingleValueSearchControl.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/Icinga/Web/Widget/SingleValueSearchControl.php b/library/Icinga/Web/Widget/SingleValueSearchControl.php index 548abcec5..99bbc5c4d 100644 --- a/library/Icinga/Web/Widget/SingleValueSearchControl.php +++ b/library/Icinga/Web/Widget/SingleValueSearchControl.php @@ -164,6 +164,12 @@ class SingleValueSearchControl extends Form $name ])); continue; + } elseif (empty($entries)) { + $ul->add(new HtmlElement('li', ['class' => 'failure-message'], [ + new HtmlElement('em', null, t('No results:')), + $name + ])); + continue; } else { $ul->add(new HtmlElement('li', ['class' => Suggestions::SUGGESTION_TITLE_CLASS], $name)); }