From 89a1b34480e89e8dc1d47c749f08ed1225a173e4 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 23 Oct 2017 13:41:41 -0400 Subject: [PATCH] FIX: Show the deleted icon if the quote expands a deleted topic --- app/controllers/posts_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 17796b23238..3899b4042f2 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -662,9 +662,10 @@ class PostsController < ApplicationController # Include deleted posts if the user is staff finder = finder.with_deleted if current_user.try(:staff?) post = finder.first - raise Discourse::NotFound unless post # load deleted topic post.topic = Topic.with_deleted.find(post.topic_id) if current_user.try(:staff?) + raise Discourse::NotFound unless post.topic + guardian.ensure_can_see!(post) post end