DNNCommunity / DNN.Forum

DNN.Forum
9 stars 7 forks source link

PostConnector.SubmitExternalPost (12 args) crash #10

Closed roman-yagodin closed 7 years ago

roman-yagodin commented 7 years ago
InnerMessage:Object reference not set to an instance of an object.

InnerStackTrace:

   at DotNetNuke.Modules.Forum.Configuration..ctor(Int32 ModuleID)
   at DotNetNuke.Modules.Forum.Configuration.GetForumConfig(Int32 ModuleID)
   at DotNetNuke.Modules.Forum.ForumUserInfo..ctor(Int32 ModuleId)
   at DotNetNuke.Modules.Forum.ForumUserController.UserCheck(Int32 UserID, Int32 PortalID, Int32 ModuleID)
   at DotNetNuke.Modules.Forum.ForumUserController.GetForumUser(Int32 UserID, Boolean UpdateLastVisit, Int32 ModuleID, Int32 PortalID)
   at DotNetNuke.Modules.Forum.PostInfo.get_Author()
   at DotNetNuke.Modules.Forum.ForumEmail.RenderKeywords(Hashtable Keywords, Object objInfo, ForumContentTypeID ContentType, String PostUrl, String ProfileUrl, String Notes, Int32 TabID)
   at DotNetNuke.Modules.Forum.ForumEmail.GenerateEmail(String Notes, ForumEmailType emailType, Int32 ContentID, Configuration objConfig, String URL, String ProfileURL, Int32 PortalID)
   at DotNetNuke.Modules.Forum.Utilities.ForumUtils.SendForumMail(Int32 ContentID, String URL, ForumEmailType EmailType, String Notes, Configuration objConfig, String ProfileURL, Int32 PortalID)
   at DotNetNuke.Modules.Forum.PostConnector.HandleNotifications(Boolean IsModerated, Configuration objConfig, PostInfo newPostInfo, ForumEmailType emailType, Int32 TabID, Int32 PortalID)
   at DotNetNuke.Modules.Forum.PostConnector.PostToDatabase(Int32 TabID, Int32 ModuleID, Configuration objConfig, Int32 PortalID, ForumUserInfo objForumUser, String PostSubject, String PostBody, ForumInfo objForum, Int32 ParentPostID, Int32 PostID, Boolean IsPinned, Boolean IsClosed, Boolean ReplyNotify, ThreadStatus Status, String lstAttachmentFileIDs, String RemoteAddress, Int32 PollID, Int32 ThreadID, PostAction objAction, Boolean IsModerated, List`1 Terms)
   at DotNetNuke.Modules.Forum.PostConnector.PostingValidation(Int32 TabID, Int32 ModuleID, Int32 PortalID, Int32 UserID, String PostSubject, String PostBody, Int32 ForumID, Int32 ParentPostID, Int32 PostID, Boolean IsPinned, Boolean IsClosed, Boolean ReplyNotify, ThreadStatus Status, String lstAttachmentFileIDs, String RemoteAddress, Int32 PollID, Boolean IsQuote, String Provider, Int32 ThreadID, List`1 Terms)
   at DotNetNuke.Modules.Forum.PostConnector.SubmitExternalPost(Int32 TabID, Int32 ModuleID, Int32 PortalID, Int32 UserID, String PostSubject, String PostBody, Int32 ForumID, Int32 ParentPostID, String Attachments, String Provider, Int32 ParentThreadID, List`1 Terms)

Caused just by passing ParentThreadID = 0 instead of -1.

As documentation on ParentThreadID is missing, and documentation on ParentPostID says that "if you are starting a new thread this should be equal to 0" - it's easy thing to make that mistake.

juvander commented 7 years ago

Are you sure that this caused it? Are you able to debug from which line this exception is coming? There is lots of code inside this ctor...

juvander commented 7 years ago

ParentThreadID should be -1 when creating new thread.

roman-yagodin commented 7 years ago

My thanks, @juvander!

juvander commented 7 years ago

đŸ˜€, closing