10 Comments

  1. Kai
    December 29, 2010 @ 3:22 am

    This symfony configuration reference could be usefull: http://www.symfonyreference.com

    Reply

  2. David Clark
    February 28, 2011 @ 3:37 pm

    I think there is a typo in step 4.

    myDoctrineGuardAdminForm does not work – should it be myGuardUserAdminForm

    Reply

  3. Richard Linkster
    March 28, 2011 @ 9:39 pm

    Should “cp plugins/sfDoctrineGuard/modules/sfGuardUser/config/* apps/backend/modules/sfGuardUser/config/” be instead “cp plugins/sfDoctrineGuardPlugin/modules/sfGuardUser/config/* apps/backend/modules/sfGuardUser/config/”?

    Reply

    • Jacob Mather
      March 29, 2011 @ 7:06 am

      Thanks Richard, I appreciate you pointing that out!

      Reply

  4. Richard Linkster
    April 7, 2011 @ 11:48 pm

    I have successfully followed your guide and added a user profile object. Thanks!

    However, now I want to have one of the attributes of the profile have a many-to-many relationship with the user profile. For example, I want to relate one or more phone numbers to the user profile where these phone numbers may be associated with other users (imagine users who live in the same house and hence have the same phone number).

    I was able to get the multi-select to appear in the edit form, but whenever I press “save” nothing is saved. Can you give some advice on how I might need to alter your steps to do this?

    Reply

    • Jacob Mather
      April 8, 2011 @ 8:22 am

      Richard,

      Being an embedded form, sfGuardUserProfileForm doesn’t get the method called that it needs to have called to save the many-to-many relationship by default.

      https://github.com/jmather/majaxDoctrineMediaPlugin/blob/master/lib/form/doctrine/majaxMediaRegistryEntryEmbeddedForm.class.php <-- this is what my embedded form that has a many-to-many relationship that has to be saved looks like. I'm not sure if all pieces are needed at this point, but I know it works. You'll replace $this->saveGalleriesList($con) with the m2m function doctrine created for you (look in your BasesfGuardUserProfileForm class and it should be obvious).

      If you need more help, look for me on #symfony on FreeNode IRC. If that’s gibberish, go to http://webchat.freenode.net and use #symfony for channels.

      Reply

      • Richard Linkster
        April 10, 2011 @ 1:41 am

        I found the method $this->saveSitesList($con) in the BasesfGuardUserProfileForm class. But now I do not know where or in which file to call this method.

        Reply

        • Jacob Mather
          April 10, 2011 @ 7:39 am

          Add it to the saveEmbeddedForms function in myGuardUserAdminForm. If it still doesn’t work, add the isValid and processValues functions from the file I referenced.

          Reply

  5. David Clark
    July 29, 2011 @ 4:30 pm

    I have resorted to creating a new model, following this code exactly.

    I get The “sfGuardUserProfileForm” form only accepts a “sfGuardUserProfile” object.

    Reply

  6. Timo
    August 10, 2011 @ 11:12 am

    Hi!
    Thank you for this, this is exactly what i needed. I like your approach for the cleanest solution possible, i use to work the same way, even when it takes 3 times as long.
    Unfortunately, with my implementation comes a strange bug i don’t really understand right now: The mask to create a new user is rendered twice: Once with the standard values coming from the original table and once including the fields from the profile table.
    I also changed the label of the “password again” field in the generator.yml, which is set on both, the one only containing the original fields and the new one containing also the fields from the profile table…
    I guess it has something to do with the

    unset($form[self::$CSRFFieldName]);

    inside the embedMergeForm function, but i don’t know how to solve this.
    By the way, i use Symfony 1.4 and of course cleared the cache đŸ˜‰
    Any idea would be greatly appreciated… Thanks in advance!
    Greets, Timo

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *