ZF-12027: Zend_Form::GetValues() not rendered congruent with post data
Description
Adding a subform to a Zend_Form, and setting isArray to false will properly add that subform with expected markup, such that the subform creates appropriate array notation (The $_POST data does not show subform values in a nested array).
However, calling the form's getValues() method renders the data differently, in that the returned result will put the subform's values into a sub-array.
Wouldn't it be expected that a request->getPost() and a form->getValues() would have a congruent structure?
Comments
Posted by Frank Brückner (frosch) on 2012-01-27T07:45:57.000+0000
Hi Matthew, can you provide a complete code example to reproduce the problem? Thanks!
Posted by Matthew Larson (matthewmatician) on 2012-01-27T14:34:37.000+0000
Sure:
Post Data:'; echo 'Form Values'; } } }Just run the view, put in some values, and see that the two outputted arrays don't have the same structure.
Posted by Matthew Larson (matthewmatician) on 2012-01-27T16:58:18.000+0000
Also, the same issue exists for Zend_Form::getValidValues().
Posted by Matthew Larson (matthewmatician) on 2012-01-27T17:14:23.000+0000
I did a review of the code. I believe I have established a fix:
Hope this helps!
Posted by Stewart Lord (stewartlord) on 2012-03-21T23:32:47.000+0000
Note, this same problem also affects getMessages(). The fix is nearly identical.
Removing the offending line fixes the problem.