Issues

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

allow a form to use string "0" in its name.

Fix for the whole Zend_Form package in ZF-ver-1.10.2-Fix-Issue-ZF-9350-Zend_Form.diff

Fixed in [ZF-9401]

Reopened because suggested fix is not reviewed and committed yet.