Hi jyrgen
My guess is that whey you are calling:
$this->Author->User->saveField('password', md5($pw1));
Cake is passing the id or Author as the id of the User record to save.
Therefore if there is no record that matches the id, a new one will be
created.
I would just go for a save() instead (meaning that you can specify the
id on the User record so Cake will know which record to update.
Regards,
Langdon
> i'm having a silly problem with saving data to a related model.
>
> -----
>
> class AuthorsController extends AppController{
>
> var $uses = array('Author', 'User');
> ----
>
> In my edit form i'd like to be able to save passwords
> (they belong to the User model.)
> But everytime cake creates a new User record instead
> of just updating the password field.
>
> $this->Author->User->saveField('password', md5($pw1));
>
> Is it because i have to tell the foreign ID ?
>
> Sorry but i'm stuck here,
> thanks a ton,
>
> Jyrgen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---