1

Closed

GetUserName throws exception if a member has deleted his/her account

description

If a member has written a message on the forum then deleted his/her account
uForum will throw this exception (see stacktrace):
 
No node exists with id '1106'
No node exists with id '1106'
at umbraco.cms.businesslogic.CMSNode.setupNode()
at umbraco.cms.businesslogic.member.Member.setupNode()
at umbraco.cms.businesslogic.CMSNode..ctor(Int32 Id)
at umbraco.cms.businesslogic.Content..ctor(Int32 id)
at umbraco.cms.businesslogic.member.Member..ctor(Int32 id)
at umbraco.providers.members.UmbracoMembershipProvider.GetUser(Object providerUserKey, Boolean userIsOnline)
at System.Web.Security.Membership.GetUser(Object providerUserKey, Boolean userIsOnline)
at System.Web.Security.Membership.GetUser(Object providerUserKey)
at uForum.Businesslogic.Services.AuthorizationService.GetUserName(String id)
at uForum.Library.Xslt.GetUserName(String id)
Closed Nov 11, 2010 at 5:56 PM by mortenbock
Fixed by changeset 52329

comments

simmdk wrote Aug 3, 2010 at 10:06 AM

Quick fix:
in uforum/library/xslt.cs replace method with this

public string GetUserName(string id)
    {
        try
        {
            AuthorizationService auth = new AuthorizationService();
            return auth.GetUserName(id);
        }
        catch {
            return "user deleted";
        }
    }

wrote Nov 11, 2010 at 4:39 PM

wrote Nov 11, 2010 at 5:55 PM

wrote Nov 11, 2010 at 5:56 PM

wrote Feb 13, 2013 at 11:25 PM

wrote May 16, 2013 at 4:34 AM