ZF-12166: Form end tag is still generated if content is boolean false

Issue Type: Bug Created: 2012-04-20T23:50:57.000+0000 Last Updated: 2012-04-24T07:35:14.000+0000 Status: Closed Fix version(s): Reporter: Jamie Krasnoo (jkrasnoo) Assignee: Frank Brückner (frosch) Tags: - Zend_View

  • zend-form-element
  • zend-view-helper

Related issues: - ZF-11747



According to the docs for Zend_View helpers the form helper should not generate a form end tag if $content is boolean false.

form($name, $attribs, $content): Generates an XHTML form. All $attribs are escaped and rendered as XHTML attributes of the form tag. If $content is present and not a boolean FALSE, then that content is rendered within the start and close form tags; if $content is a boolean FALSE (the default), only the opening form tag is generated.

This is not the case. Despite the helper's content parameter is false by default the end tag is still generated.


Posted by Jamie Krasnoo (jkrasnoo) on 2012-04-20T23:51:40.000+0000

patch for a fix

Index: Form.php

--- Form.php (revision 2) +++ Form.php (working copy) @@ -73,11 +73,9 @@ . '>';

     if (false !== $content) {
  • $xhtml .= $content; + $xhtml .= $content . ''; }

  • $xhtml .= '';

  • return $xhtml; } }

Posted by Frank Brückner (frosch) on 2012-04-22T07:31:47.000+0000

Hi Jamie, to implement your patch a CLA is needed. Can you provide an unit test? Thanks.

Posted by Jamie Krasnoo (jkrasnoo) on 2012-04-23T17:09:57.000+0000

I'll turn in the CLA as soon as I can. This can be closed. Referencing ZF-11747 which apparently fixed something that wasn't a bug and was working as intended in the documentation. According to the comments ZF-11747 has been reverted and the fix will be in 1.11.12.

Have you found an issue?

See the Overview section for more details.


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

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