Fix #4584: Disable deleted post filter when searching for status:appealed.
This commit is contained in:
@@ -912,8 +912,9 @@ class PostQueryBuilder
|
||||
metatags
|
||||
end
|
||||
|
||||
# XXX unify with PostSets::Post#show_deleted?
|
||||
def hide_deleted?
|
||||
has_status_metatag = select_metatags(:status).any? { |metatag| metatag.value.downcase.in?(%w[deleted active any all]) }
|
||||
has_status_metatag = select_metatags(:status).any? { |metatag| metatag.value.downcase.in?(%w[deleted active any all unmoderated modqueue appealed]) }
|
||||
hide_deleted_posts? && !has_status_metatag
|
||||
end
|
||||
end
|
||||
|
||||
@@ -373,6 +373,18 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_response :success
|
||||
assert_select "#post_#{@post.id}", 1
|
||||
end
|
||||
|
||||
context "with the hide_deleted_posts option enabled" do
|
||||
should "show deleted posts when searching for status:appealed" do
|
||||
@user.update!(hide_deleted_posts: true)
|
||||
create(:post_appeal, post: @post)
|
||||
|
||||
get_auth posts_path(tags: "status:appealed"), @user
|
||||
|
||||
assert_response :success
|
||||
assert_select "#post_#{@post.id}", 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "with restricted posts" do
|
||||
|
||||
Reference in New Issue
Block a user