Skip to content

Commit dd30388

Browse files
authored
Merge pull request #29 from DNNCommunity/fix_25
Fix for issue #25
2 parents 35f405a + 97819e5 commit dd30388

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

branches/DNN_5/Components/Controllers/ThreadController.vb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,20 @@ Namespace DotNetNuke.Modules.Forum
367367
sitem.TabId = moduleInfo.TabID
368368
Dim cntThread As New ThreadController()
369369
Dim objThread As ThreadInfo = cntThread.GetThread(thread.ThreadID)
370+
371+
'This is to make sure all items have ContentItem created (upgrade issue)
372+
If objThread.ContentItemId < 1 Then
373+
Dim cntContent As New Content
374+
objThread.ModuleID = moduleInfo.ModuleID
375+
objThread.TabID = moduleInfo.TabID
376+
objThread.SitemapInclude = objThread.ContainingForum.EnableSitemap
377+
378+
cntContent.CreateContentItem(objThread, moduleInfo.TabID)
379+
380+
DotNetNuke.Modules.Forum.Components.Utilities.Caching.UpdateThreadCache(objThread.ThreadID)
381+
objThread = cntThread.GetThread(thread.ThreadID)
382+
End If
383+
370384
Dim ters As List(Of String) = GetTags(moduleInfo.Terms)
371385

372386
For Each Term As Entities.Content.Taxonomy.Term In objThread.Terms
@@ -385,6 +399,8 @@ Namespace DotNetNuke.Modules.Forum
385399
Catch ex As System.InvalidCastException
386400
'There are cases when isearch does not return correctly so just catch & log
387401
log.Error("Search Portal: " + moduleInfo.PortalID.ToString, ex)
402+
Catch ex2 As SystemException
403+
log.Error("Search Portal: " + moduleInfo.PortalID.ToString, ex2)
388404
End Try
389405
Return retval
390406
End Function

branches/DNN_5/Components/Controllers/UserController.vb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ Namespace DotNetNuke.Modules.Forum
820820
Dim timeOut As Int32 = ForumUserInfoCacheTimeout * Convert.ToInt32(Entities.Host.Host.PerformanceSetting)
821821

822822
Dim cntForumUser As New ForumUserController
823-
Dim fUser As New ForumUserInfo(ModuleID)
823+
Dim fUser As ForumUserInfo
824824
fUser = cntForumUser.UserGet(PortalID, UserID, ModuleID)
825825

826826
'' we could not find this forum user

0 commit comments

Comments
 (0)