Fix #4895: Deleted forum topics visible by default in index.

The bug was that since search parameters normally come from URL request
parameters, a string value is expected here.
This commit is contained in:
evazion
2021-10-01 17:13:59 -05:00
parent 6c7fbb96b3
commit ad523b3745
2 changed files with 10 additions and 1 deletions

View File

@@ -17,7 +17,7 @@ class ForumTopicsController < ApplicationController
def index
if request.format.html?
limit = params.fetch(:limit, 40)
@forum_topics = authorize ForumTopic.visible(CurrentUser.user).paginated_search(params, limit: limit, defaults: { order: "sticky", is_deleted: false })
@forum_topics = authorize ForumTopic.visible(CurrentUser.user).paginated_search(params, limit: limit, defaults: { order: "sticky", is_deleted: "false" })
else
@forum_topics = authorize ForumTopic.visible(CurrentUser.user).paginated_search(params)
end