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

Patch and unit test added.

Fixed in SVN r24824.

Test fails on Windows

Attaching patch that fixes fail on Windows

@Martin Well spotted.

Fixed test for Windows.