ZF-2714: Form Image setAttrib() not rendering to html

Description

Using setAttrib() to set class for Image Element dose not render to html (class="") however this method works for other form elements.

Also the helper in the Image attributes is formText. Shouldn't that be formImage?


$image = new Zend_Form_Element_Image('submitImage');
$image->setLabel('')
            ->setValue('image.gif')
            ->setAttrib('class', 'button')
            ->setAttrib('foo', 'bar');

var_dump($image->getAttribs());

Outputs: array(3) { ["helper"]=> string(8) "formText" ["class"]=> string(6) "button" ["foo"]=> string(3) "bar" }

HTML:

This behavior is with Zend_Form_Element_Image and not with any other (Text, Textarea, etc.), these all render the attrib to html.

Comments

Unsetting 'fix version' and 'fix version priority' until this issue is reviewed. Assigning to Matthew for review.

Image decorator is indeed not pulling in element properties to set element attributes; scheduling for GA release.

Fix committed to trunk and release branch