ErrorLabeller: Use an element's name if no label is set
This commit is contained in:
parent
59ff4221f6
commit
4f0b4e55ef
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue