Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • PierreD Savard 183 posts 290 karma points
    Feb 08, 2013 @ 20:16
    PierreD Savard
    0

    Membre profile work but not SAVED

    Hi expert!

    I try to make my custom profile working. I follow the http://www.aaron-powell.com/umbraco-members-profiles ;

    The profile work good, If I add some data directly in the Umbraco BackEnd, I can use it in my user control. But If I create a new user and then try to update profile information, I got no error but the backend members property still empty.

    I save like this:

    MemberProfile p = MemberProfile.GetUserProfile(user.UserName);
    p.Prenom = txtPrenom.Text;
    p.Nom = txtNom.Text;
    p.Adresse = txtAdresse.Text;
    p.Tel = txtTel1.Text;
    p.Via = Convert.ToInt32(cboAch.SelectedValue);

    p.Save();

    I am user Umbraco 6.0.0 RC.

  • PierreD Savard 183 posts 290 karma points
    Feb 12, 2013 @ 14:39
    PierreD Savard
    0

    Nobody have a suggestion? 

    All profile process work like expected, I can read, use and display data from MemberProfile.GetUserProfile(user.UserName);

    But I can't save anything if I do not pass in the umbraco Member section and add the info manually.

  • PierreD Savard 183 posts 290 karma points
    Feb 12, 2013 @ 15:09
    PierreD Savard
    0

    I try to add:

    applicationName="/" in each profile, role or membership provider.

    And i use p.SetPropertyValue("firstname",txtfirstName.Text);  instead of profile.FirstName

    Nothing saved... It is possible to debug inside the umbraco.providers.members.UmbracoProfileProvider ?

  • Dmitrij Jazel 86 posts 179 karma points
    Feb 13, 2013 @ 19:53
    Dmitrij Jazel
    0

    Hej Pierre,

    If you are using MembershipUser class, maybe you want to take a look here.

    http://msdn.microsoft.com/en-us/library/system.web.security.membershipuser.aspx

    In one of the lines it says:

    "MembershipUser object is required by the UpdateUser method when you want to update the information for an existing membership user."

    Not sure if that will help, but atleast I try :-)

    //Dmitrij

  • PierreD Savard 183 posts 290 karma points
    Feb 13, 2013 @ 20:14
    PierreD Savard
    0

    Thanks for reply.

    I test that with this code:

    MembershipUser user = Membership.GetUser();
    MemberProfile p = MemberProfile.GetUserProfile(user.UserName);
    p.MyTest = "Something";
    p.save();
    Membership.UpdateUser(user);

    same result. No error, no update.

  • Dmitrij Jazel 86 posts 179 karma points
    Feb 13, 2013 @ 20:20
    Dmitrij Jazel
    0

    Hmm... well maybe this can help somehow?

    http://forums.asp.net/t/1816853.aspx/1

  • PierreD Savard 183 posts 290 karma points
    Feb 14, 2013 @ 03:36
    PierreD Savard
    0

    do we have some work around for this? Can we use the new Services.ContentService; ? I try to get an member with: IContent NodeMembre = contentService.GetById(Convert.ToInt32(user.ProviderUserKey));

    again, no sucess...

    I am runing out of idea. I don't understand why I can read the profile custom properties but I can't write! Like if the profile was readonly!

  • PierreD Savard 183 posts 290 karma points
    Feb 14, 2013 @ 04:01
    PierreD Savard
    0

    I found the problem and share for the community.

    According to Sebastiann Janssen reply in the issues umbraco page: http://issues.umbraco.org/issue/U4-1561 the problem is a kown one. Sebastiann suggest to fall back with the deprecated member object. So I do that:

                    Member Mem;

                    Mem = Member.GetMemberFromLoginName(user.UserName);

                    Mem.getProperty("prenom_client").Value = txtPrenom.Text;

                    Mem.getProperty("nom_client").Value = txtNom.Text;

                    Mem.getProperty("adresse_client").Value = txtAdresse.Text;

                    Mem.getProperty("tel_client").Value = txtTel1.Text;

                    Mem.getProperty("acheminer_via").Value = Convert.ToInt32(cboAch.SelectedValue);

                    //Generate member Xml Cache

                    Mem.XmlGenerate(new System.Xml.XmlDocument());

                    //Save member

                    Mem.Save();  

    and it work!

    I hope Umbraco will post an update on this!

    Thanks for your help.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies