Details
Description
If you have a display group within a sub form, the elements contained by the display group do not get namespaced within the rendered form correctly, which leads to issues during form submission.
For example:
$subForm = new Zend_Form_SubForm(); $subForm->setLegend('Attributes'); $subForm->addElement('text', 'foo') ->addElement('text', 'bar') ->addDisplayGroup(array('foo', 'bar'), 'foobar'); $form = new Zend_Form(); $form->addSubForm($subForm, 'attributes'); echo $form->render(new Zend_View());
One would expect the following HTML:
<form enctype="application/x-www-form-urlencoded" action="" method="post"> <dl class="zend_form"> <dt></dt> <dd><fieldset id="attributes"> <legend>Attributes</legend> <dl> <dt></dt> <dd><fieldset id="foobar"><dl> <dt></dt> <dd><input type="text" name="attributes[foo]" id="attributes-foo" value=""></dd> <dt></dt> <dd><input type="text" name="attributes[bar]" id="attributes-bar" value=""></dd> </dl></fieldset></dd> </dl> </fieldset></dd> </dl> </form>
But the following is actually received:
<form enctype="application/x-www-form-urlencoded" action="" method="post"> <dl class="zend_form"> <dt></dt> <dd><fieldset id="attributes"> <legend>Attributes</legend> <dl> <dt></dt> <dd><fieldset id="foobar"><dl> <dt></dt> <dd><input type="text" name="foo" id="foo" value=""></dd> <dt></dt> <dd><input type="text" name="bar" id="bar" value=""></dd> </dl></fieldset></dd> </dl> </fieldset></dd> </dl> </form>
Issue Links
| This issue is related to: | ||||
| ZF-3146 | wrong behaviour conected with setElementsBelongTo |
|
|
|
Resetting 'fix version priority' and 'fix version' to be re-evaluated for next release.