The issue is specifically that if you have some forms with the following structure ( hopefully ascii formatting is preserved )
$_POST
|
|___ [ 'form']
|
|___[ 'element' ] // a sub-form name of element
|
|___[ 'element' ] // an element with the name element
now if $_POST['form'] corresponds to $form, and $_POST['form']['element'] corresponds to $form->getSubForm( 'element' ),
I understand that:
the sub-form needs to be able to validate off $_POST as well as $_POST['form']['element']
It uses the dissolveArray and belongsTo features to get at the array located at $_POST['parent_form']['child_form']
but the current implementation backfires, since the sub-form is an "isArray" form, the dissolveArrayValue() method does not work as intended,
when passing $_POST['form']['element'] the above array structure to isValid() method, the Zend_Form component "thinks" the array key in the $data array for the
element ( which contains a string ) is actually $_POST['form']['element'] ( which is already assigned to $data within the scope of that method )
Matthew wrote "Not going to fix.
We use array access and overloading within Zend_Form, and use it to pull elements, display groups, and sub forms. As such, sub form names and element names must be unique even between the types."
which confuses me because it doesnt even sound like were talking about the same thing,
Did I find a bug or am I being dense?
Matthew's response was
"We use array access and overloading within Zend_Form, and use it to pull elements, display groups, and sub forms. As such, sub form names and element names must be unique even between the types."
josh.ribakoff wrote:
http://framework.zend.com/issues/browse/ZF-6480If you have an object of class Zend_Form called $parent_form for instance,
and an object of Zend_Form_SubForm called $child_form, then you add an
element called 'foo' to the $child_form, then add $child_form to the
$parent_form with the sub-form name 'foo', it does not work