Sunday, February 26, 2012

CakePHP 2.1 Submits Duplicate Array Values

I upgraded my app to 2.1 and noticed that form fields which submit as
arrays would have duplicate entries each time I submitted. For
example:

<input type="hidden" name="answers[]" value="1" />
<input type="hidden" name="answers[]" value="2" />
<input type="hidden" name="answers[]" value="3" />

Would return the following array in $this->request->data:

$answers = array("1", "2", "3", "1", "2", "3");

This doesn't seem right. I've been trying to figure out why and just
been going around in circles. Ideas?

Thanks.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: