FIX: Disallow featuring hidden topics (#8814)

This commit is contained in:
Mark VanLandingham
2020-01-30 10:00:49 -06:00
committed by GitHub
parent dc34c24ffe
commit 089d38e9d3
4 changed files with 21 additions and 4 deletions

View File

@@ -42,6 +42,10 @@ TopicStatusUpdater = Struct.new(:topic, :user) do
DiscourseEvent.trigger(:topic_closed, topic)
end
if status.visible? && status.disabled?
UserProfile.remove_featured_topic_from_all_profiles(topic)
end
if @topic_status_update
if status.manually_closing_topic? || status.closing_topic?
topic.delete_topic_timer(TopicTimer.types[:close])