Hi jakobjp, I have exact the same problem. Did you found a solution? On 13 Jul., 11:50, jakobjp <[email protected]> wrote: > Hi Joshua. > > Thanks for your response, but unfortunately you misunderstood the > issue. > > I am NOT asking for the format of the $data array, but the $fieldList > (an option that can be passed on to thesaveAll() function). > > According to the CakePHP docs (your link): "If $fieldListis not > supplied, a malicious user can add additional fields to the form data, > and by this change fields that were not originally intended to be > changed." > > Now, passing an Array like below to $this->User->save($data, > $fieldList) is fine: > $fieldList= array( > 'first_name', > 'last_name', > ); > > QUESTION: How aboutsaveAll() with multiple Models (like in my example > in the first post)? How should the $fieldListarray look? > > On Jul 13, 4:50 am, joshua <[email protected]> wrote: > > > > > > Take a look at the chapter ' 3.7.4 Saving Your > > > Data<http://book.cakephp.org/view/75/Saving-Your-Data#Saving-Related-Model...>' > > > in cakebook. > > > Array > > ( > > [Article] => Array > > ( > > [title] => My first article > > ) > > [Comment] => Array > > ( > > [0] => Array > > ( > > [comment] => Comment 1 > > [user_id] => 1 > > ) > > [1] => Array > > ( > > [comment] => Comment 2 > > [user_id] => 2 > > ) > > ) > > ) > > > $this->Article->saveAll($data); > > > On Mon, Jul 13, 2009 at 4:34 AM, jakobjp <[email protected]> wrote: > > > > I cannot get the $fieldListto work for Model->saveAll() not matter > > > what I try. > > > > How should the $fieldListarray be formatted when storing a Model plus > > > associated Models viasaveAll()? > > > > My example: > > > > Form fields: > > > User.first_name > > > User.last_name > > > Address.street > > > Address.city > > > ... > > > > The two models User and Adresse are associated with the User "hasOne" > > > Address. > > > -- > > Thanks > > Joshua > > 5span Inc. <https://www.5span.com>
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
