Fix #3410: Unable to create a new wiki page.
Fix `Post.fast_count(nil)` failing when the user had the "safe mode" or "deleted post filter" options turned on.
This commit is contained in:
@@ -1136,6 +1136,7 @@ class Post < ApplicationRecord
|
||||
|
||||
module CountMethods
|
||||
def fast_count(tags = "", options = {})
|
||||
tags = tags.to_s
|
||||
tags += " rating:s" if CurrentUser.safe_mode?
|
||||
tags += " -status:deleted" if CurrentUser.hide_deleted_posts? && tags !~ /(?:^|\s)(?:-)?status:.+/
|
||||
tags = Tag.normalize_query(tags)
|
||||
|
||||
Reference in New Issue
Block a user