Skip to content

Commit

Permalink
Fixing DNN8 search due to changes from DNN9
Browse files Browse the repository at this point in the history
  • Loading branch information
juvander committed Oct 17, 2018
1 parent 37c0ccd commit 35f405a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
7 changes: 3 additions & 4 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.Description = HtmlUtils.ConvertToText(HttpUtility.HtmlDecode(thread.Body))
sitem.Description = HtmlUtils.Clean(System.Web.HttpUtility.HtmlDecode(thread.Body), False)
sitem.AuthorUserId = thread.CreatedByUser
sitem.Body = HtmlUtils.Shorten(HtmlUtils.ConvertToText(HttpUtility.HtmlDecode(thread.Body)), 100, "...")
sitem.Body = HtmlUtils.Clean(System.Web.HttpUtility.HtmlDecode(thread.Body), False)
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 = "forumid=" & thread.ForumID & "&postid=" & thread.PostID & "&scope=posts"
'sitem.RoleId
'sitem.SearchTypeId
sitem.TabId = moduleInfo.TabID
Expand All @@ -379,7 +379,6 @@ Namespace DotNetNuke.Modules.Forum
sitem.Title = HttpUtility.HtmlDecode(thread.Subject)
sitem.UniqueKey = thread.PostID.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
7 changes: 0 additions & 7 deletions branches/DNN_5/Components/Utilities/Links.vb
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,6 @@ Namespace DotNetNuke.Modules.Forum.Utilities
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 35f405a

Please sign in to comment.