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 6:56 PM by mortenbock
Fixed by changeset 52329

comments

simmdk wrote Aug 3, 2010 at 11: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 5:39 PM

wrote Nov 11, 2010 at 6:55 PM

wrote Nov 11, 2010 at 6:56 PM

wrote Feb 14, 2013 at 12:25 AM

wrote May 16, 2013 at 5:34 AM