From 4f0b4e55efd236f955fe216750a6b4adfb6ade99 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 22 May 2015 14:01:26 +0200 Subject: [PATCH] ErrorLabeller: Use an element's name if no label is set --- library/Icinga/Web/Form/ErrorLabeller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/Web/Form/ErrorLabeller.php b/library/Icinga/Web/Form/ErrorLabeller.php index 455f5f81e..f66260149 100644 --- a/library/Icinga/Web/Form/ErrorLabeller.php +++ b/library/Icinga/Web/Form/ErrorLabeller.php @@ -39,7 +39,7 @@ class ErrorLabeller extends Zend_Translate_Adapter protected function createMessages($element) { - $label = $element->getLabel(); + $label = $element->getLabel() ?: $element->getName(); return array( Zend_Validate_NotEmpty::IS_EMPTY => sprintf(t('%s is required and must not be empty'), $label),