From ed3e0a4157fcfaa642ab5b7128c5c866c9a5cd06 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 15 Feb 2018 17:11:23 -0500 Subject: [PATCH] FIX: If a topic is deleted, allow the staff note to link to it anyway --- plugin.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugin.rb b/plugin.rb index 44aa741..f865ee0 100644 --- a/plugin.rb +++ b/plugin.rb @@ -107,7 +107,14 @@ after_initialize do end def post_url - object[:post].try(:url) + url = object[:post].try(:url) + + # In case the topic is deleted + if url == "/404" + url = "/t/#{object[:post].topic_id}/#{object[:post].post_number}" + end + + url end def post_title