Issues

ZF-10468: getValues(true) in Zend_Form yields incorrect results after using set[Elements]Belong[s]To

Issue Type: Bug Created: 2010-09-17T06:20:19.000+0000 Last Updated: 2011-01-20T13:34:42.000+0000 Status: Resolved Fix version(s): Reporter: Florian Anderiasch (winks) Assignee: Christian Albrecht (alab) Tags: - Zend_Form

Related issues: - ZF-9607

Attachments:

Description

In a form that's configured via

$form = new Foo_Form(); // extends Zend_Form $form->setElementsBelongTo('FOO');

foreach($form->getSubForms() as $name => $subform) { foreach($subform->getElements() as $element) { $element->setBelongsTo('FOO['.$name.']'); } } if($this->getRequest()->isPost() && $this->_hasParam('FOO') && $form->isValid($_POST)) { $values = $form->getValues(true); var_dump($values); }

With 1.10.2 I get the following result: array 'Attributes' => array 'AnswerToMyQuestion' => string 'answer_to_my_question_two' (length=25)

With 1.10.8 I get the following result: array 'Attributes' => array 'FOO' => array 'Attributes' => array 'AnswerToMyQuestion' => string 'answer_to_my_question_two' (length=25)

Comments

Posted by Richard Tuin (richardtuin) on 2011-01-20T13:34:11.000+0000

The latter is expected behaviour since 1.10.4. After some research it appears this change was addressed in issue ZF-9607 (patch 6 to be precise).

Have you found an issue?

See the Overview section for more details.

Copyright

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

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

Contacts