Issues

ZF-6061: Zend_View_Helper_FormSubmit with viewscript decorator produces invalid (x)html code

Issue Type: Bug Created: 2009-03-19T02:08:47.000+0000 Last Updated: 2012-06-19T19:16:31.000+0000 Status: Resolved Fix version(s): - 1.11.12 (22/Jun/12)

Reporter: Václav Vaník (dimmu) Assignee: Frank Brückner (frosch) Tags: - Zend_View

  • FixForZF1.12
  • zf-crteam-priority
  • zf-crteam-review

Related issues: - ZF-5855

Attachments: - Form.patch

Description

Example:

<pre class="highlight">
$submit = $form->createElement('submit', 'login');
$submit->setDecorators(array(array('ViewScript', array(
    'viewScript' => 'index/submit-login-form.phtml',
    'class'      => 'valhallaPopupButtons'))));

viewscript:

<pre class="highlight">
 


<?php

    echo $this->formSubmit(
               $this->element->getName(),
               $this->element->getLabel(),
               $this->element->getAttribs());

?>

    <a href="">
        <?php echo $this->escape($this->translate('Login')); ?>
    </a>

Rendered xhtml (invalid attrib helper):

<pre class="highlight">
 

<a href="/_valhalla/index/forgotten-password">
        Zapomněli jste heslo?    </a>

Possible solution: add to formSubmit method:

<pre class="highlight">
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.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts