First of all thank you for your answers,

I have latest sfGuard installed, but I can't do that anyway

I tried to edit my user/update action, here's the code

 public function executeUpdate($request)
  {
    $this->forward404Unless($request->isMethod('post'));
    $this->form = new
SfGuardUserProfileForm(SfGuardUserProfilePeer::retrieveByPk($request-
>getParameter('id')));
    $this->form->bind($request-
>getParameter('sf_guard_user_profile'));
    if ($this->form->isValid())
    {

      $this->user_acc = new sfGuardUser();
      $this->user = new SfGuardUserProfile();
      $this->user_acc->save();
      $this->user->setsfGuardUser($this->user_acc);

      $this->user_acc->setUsername($this->form->save()->getNick());

      $this->user->save();
      }
$this->setTemplate('edit');
  }

And it create a new user (in both, sf_guard_user and
sf_guard_user_profile tables),
the problem is, that if I try to create user for 2nd time, the error
is

[PropelException]
Unable to execute INSERT statement. [wrapped: Could not execute update
[Native Error: Duplicate entry '' for key 2] [User Info: INSERT INTO
sf_guard_user (CREATED_AT) VALUES ('2008-08-25 10:57:54')]]

How should I edit this code please?

thank you

On Aug 24, 11:02 am, cindy <[EMAIL PROTECTED]> wrote:
> I had the same problem, but I think Fabien (or someone) added the
> processing to the sfGuardUserForm to update the sfGuardUserProfile as
> well as sfGuardUser recently.
>
> If you update your sfGuard plugin, you should see the clode in the
> sfGuardUserForm.
>
> With this new code, it's as easy as building the model, building your
> forms, and generating the crud.  Worked like a charm for me. :)
>
> On Aug 23, 1:51 am, javo <[EMAIL PROTECTED]> wrote:
>
> > Ok thank you for your post, I choose tha way of editing CRUD (user/
> > edit)
> > can somebody show me the example of editing user/edit action, to edit
> > both sf_guard_user and sf_guard_user_profile tables and connect them?
> > thank you
>
> > On Aug 22, 4:01 pm, "Nicolas Perriault" <[EMAIL PROTECTED]> wrote:
>
> > > On Fri, Aug 22, 2008 at 4:31 PM, javo <[EMAIL PROTECTED]> wrote:
> > > > I'm new to symfony and I'd like to ask what is the best way to create
> > > > a registration, (create some simple form, use crud user model? , ...)
> > > > Is there any howto? I couldn't find anything Smile
>
> > > If you use symfony 1.0, you can take a look at what has been done for
> > > Symfonians using 
> > > sfGuard:http://symfonians.org/browser/branches/1.0/apps/main/modules/sfGuardAuth
>
> > > ++
>
> > > --
> > > Nicolas 
> > > Perriaulthttp://prendreuncafe.com-http://symfonians.net-http://sensiolabs.com
> > > Phone: +33 660 92 08 67

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to