ErrorLabeller: Use an element's name if no label is set

This commit is contained in:
Johannes Meyer 2015-05-22 14:01:26 +02:00
parent 59ff4221f6
commit 4f0b4e55ef
1 changed files with 1 additions and 1 deletions

View File

@ -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),