Skip to content

Commit

Permalink
Fixing search issues for DNN9
Browse files Browse the repository at this point in the history
  • Loading branch information
juvander committed Oct 17, 2018
1 parent b78d7c4 commit 37c0ccd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
10 changes: 5 additions & 5 deletions branches/DNN_5/Components/Controllers/ThreadController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ Namespace DotNetNuke.Modules.Forum
For Each thread In ThreadSearchCollection
'log.Debug("Search found: " + thread.Subject)
Dim sitem As Search.Entities.SearchDocument = New Search.Entities.SearchDocument()
sitem.Body = HttpUtility.HtmlDecode(thread.Body)
sitem.Description = HtmlUtils.ConvertToText(HttpUtility.HtmlDecode(thread.Body))
sitem.AuthorUserId = thread.CreatedByUser
sitem.Description = HtmlUtils.Shorten(thread.Body, 100, "...")
sitem.Body = HtmlUtils.Shorten(HtmlUtils.ConvertToText(HttpUtility.HtmlDecode(thread.Body)), 100, "...")
sitem.IsActive = True
'sitem.Keywords = Nothing
'log.Debug("UpdateDate: " + thread.UpdatedDate.ToString)
Expand All @@ -361,7 +361,7 @@ Namespace DotNetNuke.Modules.Forum
'sitem.NumericKeys
'sitem.Permissions
sitem.PortalId = moduleInfo.PortalID
'sitem.QueryString
'sitem.QueryString =
'sitem.RoleId
'sitem.SearchTypeId
sitem.TabId = moduleInfo.TabID
Expand All @@ -375,11 +375,11 @@ Namespace DotNetNuke.Modules.Forum
Next

sitem.Tags = ters

'log.Debug("TabPath: " + tinfo.TabPath)
sitem.Title = HttpUtility.HtmlDecode(thread.Subject)
sitem.UniqueKey = thread.PostID.ToString
sitem.Url = New Uri(Links.ContainerViewPostLink(moduleInfo.PortalID, moduleInfo.TabID, thread.ForumID, thread.PostID, thread.Subject), UriKind.Relative).ToString()

sitem.Url = New Uri(Links.ContainerViewQueryLink(moduleInfo.PortalID, moduleInfo.TabID, thread.ForumID, thread.PostID, thread.Subject)).PathAndQuery
retval.Add(sitem)
Next
End If
Expand Down
4 changes: 3 additions & 1 deletion branches/DNN_5/Components/Portals/ForumPortalSettings.vb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ Namespace DotNetNuke.Modules.Forum
HttpContext.Current = New HttpContext(workerRequest)
End If
'stash the portalSettings in the Context Items, where the rest of the DNN Code expects it to be
HttpContext.Current.Items.Add("PortalSettings", ps)
If (HttpContext.Current.Items.Contains("PortalSettings") = False) Then
HttpContext.Current.Items.Add("PortalSettings", ps)
End If

Return ps
End Function
Expand Down
8 changes: 7 additions & 1 deletion branches/DNN_5/Components/Utilities/Links.vb
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,16 @@ Namespace DotNetNuke.Modules.Forum.Utilities
Dim Path As String
Dim TabInfo As DotNetNuke.Entities.Tabs.TabInfo = TabController.Instance.GetTab(TabId, PortalId, False)
Path = "~/default.aspx?tabid=" & TabId & "&forumid=" & ForumId & "&postid=" & PostId & "&scope=posts"

Return DotNetNuke.Common.Globals.FriendlyUrl(TabInfo, Path, CreateFriendlySlug(PostTitle)) & "#" & PostId

End Function
Public Shared Function ContainerViewQueryLink(ByVal PortalId As Integer, ByVal TabId As Integer, ByVal ForumId As Integer, ByVal PostId As Integer, ByVal PostTitle As String) As String
Dim pSettings As PortalSettings = ForumPortalSettings.CreateNewPortalSettings(PortalId)
Dim Path As String
Dim TabInfo As DotNetNuke.Entities.Tabs.TabInfo = TabController.Instance.GetTab(TabId, PortalId, False)
Path = "~/default.aspx?tabid=" & TabId & "&forumid=" & ForumId & "&postid=" & PostId & "&scope=posts"
Return DotNetNuke.Common.Globals.FriendlyUrl(TabInfo, Path, CreateFriendlySlug(PostTitle), pSettings) & "#" & PostId
End Function

''' <summary>
''' Navigates user to specific page of results for a thread view.
Expand Down

0 comments on commit 37c0ccd

Please sign in to comment.