ZF-11860: Zend_Form -> Zend_Form_SubForm -> Zend_Form_Element::setBelongsTo - Zend_Form loses one array notation if element in subform belongs to an array

Issue Type: Bug Created: 2011-10-28T15:56:23.000+0000 Last Updated: 2011-10-28T17:40:19.000+0000 Status: Open Fix version(s): Reporter: Joni Järvinen ( Assignee: Christian Albrecht (alab) Tags: - Zend_Form

  • setBelongsTo
  • zend_form
  • zend_form_element
  • zend_form_subform

Related issues: Attachments:


I came across an annoying bug in Zend Framework and have been trying to find an answer through several forums.

The problem is that when I have a form and add a subform in it and add subform into that form and then add an element into the last subform which belongs to an array; Zend_Form loses one array from the middle.

<pre class="highlight">
$form = new Zend_Form();

$subForm1 = new Zend_Form_SubForm();

$subForm2 = new Zend_Form_SubForm();

$element = new \Zend_Form_Element_Text('textElement');


$subForm1->addSubForm($subForm2, 'subForm2');
$form->addSubForm($subForm1, 'subForm1');

echo $form->render();

<pre class="highlight">

<pre class="highlight">

If this is intentional it's totally wrong in my opinion; If elements in the subform belong to an array it doesn't mean that an element could not belong to some array itself and the elements array would then belong to the subforms belongsto array.


Posted by Frank Brückner (frosch) on 2011-10-28T17:40:19.000+0000

Code tags added.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.