SingleValueSearchControl: Add failure message for empty results

This commit is contained in:
Johannes Meyer 2021-04-07 15:59:03 +02:00
parent a6507daaaf
commit 0d35a1774d
1 changed files with 6 additions and 0 deletions

View File

@ -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));
}