Nevermind, I was trying to merge a form and there was a conflict with
the "id" DB fields.

I use embedForm now and it works perfectly...

On 22 juin, 18:20, John <drskulls...@gmail.com> wrote:
> Hi,
>
> I have a problem when trying to use a MyProfileForm that extends the
> BasesfGuardUserForm. Here it is :
>
> In sfGuardUser/action.class.php :
>
> ...
>         public function executeMyProfile() {
>                 $this->sf_guard_user = $this->getUser()->getGuardUser();
>         $this->form = new MyProfileForm($this->sf_guard_user);
>                 $this->setTemplate('edit');
>         }
> ...
>
> My problem here is at the update : it loads the page with errors on
> the sfGuardUserForm, and not on the MyProfileForm. So I tried
> overriding the executeUpdate method :
>
>          public function executeUpdate(sfWebRequest $request) {
>                 $this->sf_guard_user = $this->getRoute()->getObject();
>                 $this->form = new MyProfileForm($this->sf_guard_user);
>                 $this->form->bind($request->getParameter("sf_guard_user"));
>                 if ($this->form->isValid()) {
>                         echo "valid"; exit;
>                 } else {
>
>                 }
>          }
>
> At the update, symfony tells me there is already a user with the
> username given. I'm guessing it's trying to add a new object, while I
> just want an update !
>
> I think my problem is that the method 
> $this->configuration->getForm($this->sf_guard_user); always gives me the 
> sfGuardUserForm,
>
> though I pass a MyProfileForm.
>
> Anyone had this problem before ?
> Any solution ?
>
> Thanks a lot !
> John

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to