ZF-7015: Zend_Form "0" name bug around ElementBelongTo
Description
Zend_Form with Zend_Form_SubForm , If SubForm uses the name based on serialized number string, "0" string-zero to SubForm's name is ignored.
$form = new Zend_Form();
$form->setView($view);
$form->addSubForm(new Zend_Form_SubForm(), '0');
$form->addSubForm(new Zend_Form_SubForm(), '1');
$subform1 = $form->getSubForm('0')
->addElement(new Zend_Form_Element_Text('foo'));
echo $form;
In this case, the element renderd below But it should be below
I will attach a patch to this problem. How about it?
Comments
Posted by Tomoaki Kosugi (noopable) on 2009-06-14T22:26:56.000+0000
allow a form to use string "0" in its name.
Posted by Christian Albrecht (alab) on 2010-03-06T18:37:46.000+0000
Fix for the whole Zend_Form package in ZF-ver-1.10.2-Fix-Issue-ZF-9350-Zend_Form.diff
Posted by Christian Albrecht (alab) on 2010-03-18T08:30:15.000+0000
Fixed in [ZF-9401]
Posted by Christian Albrecht (alab) on 2010-03-25T13:24:00.000+0000
Reopened because suggested fix is not reviewed and committed yet.