A platform for community discussion. Free, open, simple.
DEV: Replace raw comments with deprecation warnings (#22617)
Ted Johansson7c0534c29240
diff --git a/app/controllers/admin/email_controller.rb b/app/controllers/admin/email_controller.rbindex 779bd875829..ce97d029d79 100644--- a/app/controllers/admin/email_controller.rb+++ b/app/controllers/admin/email_controller.rb@@ -167,11 +167,13 @@ class Admin::EmailController < Admin::AdminControllerendend- # TODO: 2022-05-01 Remove this route once all sites have migrated over- # to using the new email_encoded param.if deprecated_email_param_used- render plain:- "warning: the email parameter is deprecated. all POST requests to this route should be sent with a base64 strict encoded email_encoded parameter instead. email has been received and is queued for processing"+ warning =+ "warning: the email parameter is deprecated. all POST requests to this route should be sent with a base64 strict encoded email_encoded parameter instead. email has been received and is queued for processing"++ Discourse.deprecate(warning, drop_from: "3.3.0")++ render plain: warningelserender plain: "email has been received and is queued for processing"enddiff --git a/app/jobs/regular/toggle_topic_closed.rb b/app/jobs/regular/toggle_topic_closed.rbindex a02831ca61c..6a1c811eead 100644--- a/app/jobs/regular/toggle_topic_closed.rb+++ b/app/jobs/regular/toggle_topic_closed.rb@@ -1,10 +1,13 @@# frozen_string_literal: truemodule Jobs- # TODO: DEPRECATED - Use OpenTopic and CloseTopic instead.- # (martin - 2021-05-01) - Delete once topic timer revamp is completed.class ToggleTopicClosed < ::Jobs::Basedef execute(args)+ Discourse.deprecate(+ "ToggleTopicClosed is deprecated. Use OpenTopic and CloseTopic instead.",+ drop_from: "3.3.0",+ )+topic_timer = TopicTimer.find_by(id: args[:topic_timer_id] || args[:topic_status_update_id])# state false is Open Topicdiff --git a/app/models/user.rb b/app/models/user.rbindex bb93fbd5ec9..e46f31349ef 100644--- a/app/models/user.rb+++ b/app/models/user.rb@@ -659,11 +659,11 @@ class User < ActiveRecord::Baseresults.to_hend- ###- # DEPRECATED: This is only maintained for backwards compat until v2.5. There- # may be inconsistencies with counts in the UI because of this, because unread- # high priority includes PMs AND bookmark reminders.def unread_private_messages+ Discourse.deprecate(+ "#unread_private_messages is deprecated, use #unread_high_priority_notifications instead.",+ drop_from: "2.5.0",+ )@unread_pms ||= unread_high_priority_notificationsenddiff --git a/app/serializers/queued_post_serializer.rb b/app/serializers/queued_post_serializer.rbindex 91d64f26bfb..b8f59be95b7 100644--- a/app/serializers/queued_post_serializer.rb+++ b/app/serializers/queued_post_serializer.rb@@ -1,6 +1,5 @@# frozen_string_literal: true-# Deprecated, should be removed once users have sufficient opportunity to do soclass QueuedPostSerializer < ApplicationSerializerattributes(:id,@@ -19,6 +18,11 @@ class QueuedPostSerializer < ApplicationSerializerhas_one :created_by, serializer: AdminUserListSerializer, root: :usershas_one :topic, serializer: BasicTopicSerializer+ def initialize(object, options = {})+ Discourse.deprecate("QueuedPostSerializer is deprecated.", drop_from: "3.3.0")+ super+ end+def queue"default"end