Copied to clipboard

Flag this post as spam?

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


  • Emiliano 5 posts 25 karma points
    Oct 16, 2014 @ 18:38
    Emiliano
    0

    Updating username, GetCurrentMember() fails - Umbraco 6.1.5

    Hi folks,

    we have the case that we want to let users update their profiles, email included. The issue is that once we save LoginName and Email properties, Member.GetCurrentMember() returns null due to System.Web.HttpContext.Current.User.Identity is not updated with the new username.

    Any suggestions?

    Thanks!

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Oct 16, 2014 @ 19:06
    Jan Skovgaard
    0

    Hi Emiliano and welcome to our :)

    I'm not sure I know the answer to your question but could you please provide the code you're currently using to try and update the username? Otherwise it's a bit hard to point you in the right direction or let you know if it's a bug in the API.

    Cheers, Jan

  • Emiliano 5 posts 25 karma points
    Oct 16, 2014 @ 19:07
    Emiliano
    0

                Member member = GetMemberById(memberId);

                member.LoginName = profile.Email;

                member.Email = profile.Email;

     

                member.Save();

                member.XmlGenerate(new XmlDocument());

  • Charles Afford 1163 posts 1709 karma points
    Oct 19, 2014 @ 15:49
    Charles Afford
    0

    Hi Emiliano,

    When is the member null?

    If you debug after save is the member null then? Or is it that after save() the member still does not have anything assigned to LoginName and Email properties.

    What are the values of LoginName and Email?.

    Charlie :)

  • Emiliano 5 posts 25 karma points
    Oct 20, 2014 @ 11:31
    Emiliano
    0

    Hi Charlie,

    thanks for replying me. Your first sentence is the case: if you call Member.GetCurrentMember() after the save action, we got member null... :(

  • Charles Afford 1163 posts 1709 karma points
    Oct 27, 2014 @ 21:27
    Charles Afford
    0

    Hi Emiliano did you solve this?

    sorry been busy and did not get a notification :(

    Charlie

  • Charles Afford 1163 posts 1709 karma points
    Oct 27, 2014 @ 21:29
    Charles Afford
    0

    What is the member id you are passing in?

    Charlie

  • Emiliano 5 posts 25 karma points
    Nov 06, 2014 @ 16:31
    Emiliano
    0

    Hi Charles,

              sorry I have been on holidays. my collegue have solved the issue... actually it was our fault because we were trying to do that by ajax calls. Now forcing the redirect to a new request, it works fine.

    so that the library works fine :D

     

    Many thanks,

    Emiliano

  • Charles Afford 1163 posts 1709 karma points
    Nov 06, 2014 @ 19:14
    Charles Afford
    0

    Hi Emiliano,

    Glad you got it fixed :).

    Charlie

Please Sign in or register to post replies

Write your reply to:

Draft