ZF-3393: getValues() truncates value if textarea element as the same name as its parent subform

Issue Type: Bug Created: 2008-06-05T04:36:00.000+0000 Last Updated: 2010-03-31T09:48:48.000+0000 Status: Closed Fix version(s): - 1.11.0 (02/Nov/10)

Reporter: Francois Gaudin (alf) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Form

Related issues: - ZF-9348



if the textarea element has the same name as its parent subform. $form->getValues() returns a truncated value, remaining just one character in the foo element.

<pre class="highlight">
$foo = new Zend_Form_SubForm('foo') ;
$foo->addElement('textarea','foo') ;
$form->addSubform($foo,'foo') ;


Posted by Matthew Weier O'Phinney (matthew) on 2008-06-17T13:00:31.000+0000

While this is a bug, the simple solution is to rename your subform; this will allow validation and rendering to work correctly, and keep the element name in line with your model.

Scheduling fix for next minor release, but as a low priority issue.

Posted by Michal Vrchota (techi) on 2008-07-19T09:36:01.000+0000

This problem is regarding to all form elements, not just textarea. All elements inside subform MUST have DIFFERENT name. It is sometimes confusing and it is easy to pass over it

Posted by Christian Beier (madxray) on 2009-01-25T19:50:54.000+0000

Indeed it is. Especially if you use radio elements in the subform "foo". If you select the "foo" radio every other is auto selected. Was building an ACL interface and map resource to subform for the radio buttons of linked privileges. Nice surprise, but at least I recognised it before deployment. Hopefully I find time to diggin the code and provide a patch.

Posted by Christian Albrecht (alab) on 2010-03-18T08:21:09.000+0000

Fixed in [ZF-9348]

Posted by Christian Albrecht (alab) on 2010-03-25T13:23:59.000+0000

Reopened because suggested fix is not reviewed and committed yet.

Posted by Christian Albrecht (alab) on 2010-03-31T09:48:48.000+0000

Matthew Weier O'Phinney resolved [ZF-9348] Patch applied to trunk and 1.10 release branch.

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.