Copied to clipboard

Flag this post as spam?

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


  • Ayo Adesina 445 posts 1059 karma points
    Feb 23, 2021 @ 22:52
    Ayo Adesina
    0

    Umbraco 8 Bug? Duplicate Members

    Hi guys,

    I think I have found a bug in Umbraco (V8.10.1)

    If you add a member twice in the back office with the same username and same email. Even though Umbraco throws and error about a duplicate. - If you check the list of members you will find that the member exists twice.

    This is the same if you create a member programmatically. Umbraco throws an exception, but the member still ends up in the db... is this a bug? or am I missing something?

    I am going to change my code to look for the member first before trying to create a new one. - if this is a bug this is a pretty major one.

  • Huw Reddick 1932 posts 6722 karma points MVP 2x c-trib
    Feb 24, 2021 @ 11:44
    Huw Reddick
    0

    I have tried to replicate your issue in the back office but umbraco does not save the second member if I try to add one with the same username and email. I will check what happens in code, but the back office definitely doesn't allow me to save it.

  • Huw Reddick 1932 posts 6722 karma points MVP 2x c-trib
    Feb 24, 2021 @ 11:50
    Huw Reddick
    0

    not able to replicate in code either, it just doesn't save the second user.

  • Huw Reddick 1932 posts 6722 karma points MVP 2x c-trib
    Feb 24, 2021 @ 12:16
    Huw Reddick
    0

    ignore previous reply, I forgot my code did a check :)

    I can confirm that in code it does allow me to create a member with a duplicate username and email, just not from the back office.

  • Ayo Adesina 445 posts 1059 karma points
    Feb 24, 2021 @ 12:37
    Ayo Adesina
    0

    I will create a quick video, becuase it definitaely happens in the back office too. - It will throw an exception... but then if you go and look at the members list... you will find a duplicate member.

  • Huw Reddick 1932 posts 6722 karma points MVP 2x c-trib
    Feb 24, 2021 @ 13:03
    Huw Reddick
    0

    I tested that in both 8.10.1 and 8.11.1 and it doesn't save the member for me in the back office, it just refuses to save as expected.

  • Harry Gordon 15 posts 92 karma points c-trib
    Nov 14, 2022 @ 12:07
    Harry Gordon
    0

    For anyone else interested in this issue, there is a ticket on Github. It does not look like it will be addressed.

  • Huw Reddick 1932 posts 6722 karma points MVP 2x c-trib
    Nov 15, 2022 @ 15:04
    Huw Reddick
    0

    In my code, I just check that the username is not already registered and return a 'username is already registered' error instead of creating a new member

    var member = Members.GetByUsername(model.username);
    if(member != null){
                        error = "A member is already registerd with this username";
                        return false;
    }
    
  • 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