ZF-3393: getValues() truncates value if textarea element as the same name as its parent subform
Description
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.
$foo = new Zend_Form_SubForm('foo') ;
$foo->addElement('textarea','foo') ;
$form->addSubform($foo,'foo') ;
Comments
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.