ZF-6061: Zend_View_Helper_FormSubmit with viewscript decorator produces invalid (x)html code
Description
Example:
$submit = $form->createElement('submit', 'login');
$submit->setDecorators(array(array('ViewScript', array(
'viewScript' => 'index/submit-login-form.phtml',
'class' => 'valhallaPopupButtons'))));
viewscript:
<?php
echo $this->formSubmit(
$this->element->getName(),
$this->element->getLabel(),
$this->element->getAttribs());
?>
<?php echo $this->escape($this->translate('Login')); ?>
Rendered xhtml (invalid attrib helper):
Zapomněli jste heslo?
Possible solution: add to formSubmit method:
if (isset($attribs['helper'])) {
unset($attribs['helper']);
}
Comments
Posted by Frank Brückner (frosch) on 2012-05-09T18:19:29.000+0000
Patch and unit test added.
Posted by Rob Allen (rob) on 2012-05-29T20:27:36.000+0000
Fixed in SVN r24824.
Posted by Martin Hujer (mhujer) on 2012-06-08T16:22:23.000+0000
Test fails on Windows
Posted by Martin Hujer (mhujer) on 2012-06-08T16:22:52.000+0000
Attaching patch that fixes fail on Windows
Posted by Frank Brückner (frosch) on 2012-06-08T16:24:52.000+0000
@Martin Well spotted.
Posted by Rob Allen (rob) on 2012-06-19T19:16:31.000+0000
Fixed test for Windows.