Fix #5132: Modqueue displays active posts when excluding any search term
Fix a bug where searching for a negated tag inside the modqueue would show
active posts.
The bug was that in a search like this:
Post.in_modqueue.user_tag_match("-solo")
The `in_modqueue` condition would get sucked inside the tag search and negated
when we tried to apply the negation operator to the "solo" tag. So effectively
the `in_modqueue` condition would get negated and we would end up searching for
everything not in the modqueue.
This commit is contained in:
@@ -255,8 +255,7 @@ class PostQueryBuilder
|
||||
end
|
||||
end
|
||||
|
||||
def posts(post_query, includes: nil)
|
||||
relation = Post.all
|
||||
def posts(post_query, relation = Post.unscoped, includes: nil)
|
||||
relation = add_joins(post_query, relation)
|
||||
relation = build_relation(post_query, relation)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user