How to create user profile update form in Symfony frontend

I managed to build a user registration form and people can sign up on my website successfully. However, I’m struggling to implement a profile editing feature where logged-in users can modify their account information.

My database structure includes sf_guard_user and sf_guard_user_profile tables in the schema configuration file. I’ve attempted several approaches but none of them worked properly.

Can anyone point me to a tutorial or guide that explains how to implement profile editing functionality? I’m looking for a step-by-step solution that works with the sf_guard plugin structure.

double-check your routing for the profile update action. I had the same problem - my form was posting to the wrong URL so changes weren’t saving. also verify the user’s actually logged in when they hit the edit page.

what errors are you seeing when you update? is it throwing exceptions or failing silently? also, did u set up the profile form’s widgets correctly for the fields you want to edit?

I ran into this exact same problem with sf_guard integration. You need to create a custom form class that extends BasesfGuardUserForm and handles the embedded profile form correctly. In your user module, override the executeEdit action and instantiate your custom form with the current user object. Don’t forget to call save() on both the user and profile objects inside a transaction - otherwise you’ll get data consistency issues. The crucial part is setting up the form’s configure method to embed the profile form using embedForm. This makes both tables update at the same time when someone submits the form. Can’t say for sure without seeing your error messages, but this approach should fix your profile editing issues.

the sfDoctrineGuardPlugin docs have a built in action 4 profile editing. just extend the sfGuardUser class n make a custom form that handles both user n profile tables together. used this approach on a similar project l8r n it worked great.

hey @Leo_Wand - are you validating the form correctly when updating? I had weird issues where profile data wouldn’t stick even tho the user table updated fine. what symfony version are you using? might change which approach works best