Saturday, March 31, 2012

Bug with the "action" form tag in this->data?

Hi,
I've discovered a strange behavior in this->data. I have a form with checkboxes that looks like this:

<form action="/participants/xls" method="post" (...)>
<input type="checkbox" name="data[Participant][1][id]"  value="1" id="Participant1Id"/>
<input type="checkbox" name="data[Participant][2][id]"  value="2" id="Participant2Id"/>
<input type="checkbox" name="data[Participant][3][id]"  value="3" id="Participant3Id"/>

When I check this->data, the array looked like this (in 2.0.0 alpha, the only old version i have here):
Array
(
    [Participant] => Array
        (
            [1] => Array
                (
                    [id] => 1
                )
            [2] => Array
                (
                    [id] => 2
                )
        )

    [action] => /myapp/participants/xls
)

Now the array looks like this (since 2.0.3):
Array
(
    [Participant] => Array
        (
            [1] => Array
                (
                    [id] => 1
                )
            [2] => Array
                (
                    [id] => 2
                )
            [3] => Array
                (
                    [action] => /myapp/participants/xls
                )
        )
)

The action is in the model entry.
Do I do the mistake or is there a problem with the data array?

--
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: