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


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') ;


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.

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

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.

Fixed in [ZF-9348]

Reopened because suggested fix is not reviewed and committed yet.

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