Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/4441'
Browse files Browse the repository at this point in the history
Close #4441
  • Loading branch information
weierophinney committed May 9, 2013
2 parents 67ba034 + ccaf530 commit 3af6f8c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions library/Zend/Form/View/Helper/FormRow.php
Expand Up @@ -121,7 +121,6 @@ public function render(ElementInterface $element)

$label = $element->getLabel();
$inputErrorClass = $this->getInputErrorClass();
$elementErrors = $elementErrorsHelper->render($element);

if (isset($label) && '' !== $label) {
// Translate the label
Expand All @@ -133,7 +132,7 @@ public function render(ElementInterface $element)
}

// Does this element have errors ?
if (!empty($elementErrors) && !empty($inputErrorClass)) {
if (count($element->getMessages()) > 0 && !empty($inputErrorClass)) {
$classAttributes = ($element->hasAttribute('class') ? $element->getAttribute('class') . ' ' : '');
$classAttributes = $classAttributes . $inputErrorClass;

Expand All @@ -152,6 +151,10 @@ public function render(ElementInterface $element)
return $this->view->render($this->partial, $vars);
}

if ($this->renderErrors) {
$elementErrors = $elementErrorsHelper->render($element);
}

$elementString = $elementHelper->render($element);

if (isset($label) && '' !== $label) {
Expand Down

0 comments on commit 3af6f8c

Please sign in to comment.