Hello worthy,

use the model name in the input field name: User.id, User.email,
Customer.id.

Do you use saveAll() for saving the related data?

Regards, Christoph



On 1 Sep., 15:58, worthy <[EMAIL PROTECTED]> wrote:
> Hi bakers,
>
> I am a little screwed right now because i cannot find the simple
> solution for the following problem.
>
> I have a customer edit form. There are several fields for the customer
> model and then there is one email field from the user model.
>
> To tell cake to make an update i already put
>
> <?=$form->input('id', array('type'=>'hidden'));?>
>
> into the form. But the problem is now that when the validation of the
> User model runs through it does not use the foreign key user_id to
> validate the email but it uses the id from the hidden field above
> which belongs to the customer model.
>
> The User.email is unique so if the validation runs with the wrong id i
> get an error telling me this email already exists although i do not
> even change it in the form.
>
> How can i solve this problem?
>
> Greetings
> worthy
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to