From 97819e5777f68c9ad4bb4606c7426964fac7b1af Mon Sep 17 00:00:00 2001 From: Ilpo Juvander Date: Fri, 28 Feb 2020 12:25:56 +0200 Subject: [PATCH] Fix for issue #25 --- .../Components/Controllers/ThreadController.vb | 16 ++++++++++++++++ .../Components/Controllers/UserController.vb | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/branches/DNN_5/Components/Controllers/ThreadController.vb b/branches/DNN_5/Components/Controllers/ThreadController.vb index ea009c2..b3c50f0 100644 --- a/branches/DNN_5/Components/Controllers/ThreadController.vb +++ b/branches/DNN_5/Components/Controllers/ThreadController.vb @@ -367,6 +367,20 @@ Namespace DotNetNuke.Modules.Forum sitem.TabId = moduleInfo.TabID Dim cntThread As New ThreadController() Dim objThread As ThreadInfo = cntThread.GetThread(thread.ThreadID) + + 'This is to make sure all items have ContentItem created (upgrade issue) + If objThread.ContentItemId < 1 Then + Dim cntContent As New Content + objThread.ModuleID = moduleInfo.ModuleID + objThread.TabID = moduleInfo.TabID + objThread.SitemapInclude = objThread.ContainingForum.EnableSitemap + + cntContent.CreateContentItem(objThread, moduleInfo.TabID) + + DotNetNuke.Modules.Forum.Components.Utilities.Caching.UpdateThreadCache(objThread.ThreadID) + objThread = cntThread.GetThread(thread.ThreadID) + End If + Dim ters As List(Of String) = GetTags(moduleInfo.Terms) For Each Term As Entities.Content.Taxonomy.Term In objThread.Terms @@ -385,6 +399,8 @@ Namespace DotNetNuke.Modules.Forum Catch ex As System.InvalidCastException 'There are cases when isearch does not return correctly so just catch & log log.Error("Search Portal: " + moduleInfo.PortalID.ToString, ex) + Catch ex2 As SystemException + log.Error("Search Portal: " + moduleInfo.PortalID.ToString, ex2) End Try Return retval End Function diff --git a/branches/DNN_5/Components/Controllers/UserController.vb b/branches/DNN_5/Components/Controllers/UserController.vb index 708d884..659365e 100644 --- a/branches/DNN_5/Components/Controllers/UserController.vb +++ b/branches/DNN_5/Components/Controllers/UserController.vb @@ -820,7 +820,7 @@ Namespace DotNetNuke.Modules.Forum Dim timeOut As Int32 = ForumUserInfoCacheTimeout * Convert.ToInt32(Entities.Host.Host.PerformanceSetting) Dim cntForumUser As New ForumUserController - Dim fUser As New ForumUserInfo(ModuleID) + Dim fUser As ForumUserInfo fUser = cntForumUser.UserGet(PortalID, UserID, ModuleID) '' we could not find this forum user