DEV: Remove deprecated UsersController#modify_user_params method (#27198)

The UsersController#modify_user_params method is deprecated and replaced with a plugin modifier (users_controller_update_user_params). It is marked for removal in 3.2. This PR removes it.
This commit is contained in:
Ted Johansson 2024-05-30 09:33:19 +08:00 committed by GitHub
parent dc55b645b2
commit 078d363510
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2130,8 +2130,6 @@ class UsersController < ApplicationController
result.merge!(params.permit(:active, :staged, :approved))
end
deprecate_modify_user_params_method
result = modify_user_params(result)
DiscoursePluginRegistry.apply_modifier(
:users_controller_update_user_params,
result,
@ -2140,23 +2138,6 @@ class UsersController < ApplicationController
)
end
# Plugins can use this to modify user parameters
def modify_user_params(attrs)
attrs
end
def deprecate_modify_user_params_method
# only issue a deprecation warning if the method is overridden somewhere
if method(:modify_user_params).source_location[0] !=
"#{Rails.root}/app/controllers/users_controller.rb"
Discourse.deprecate(
"`UsersController#modify_user_params` method is deprecated. Please use the `users_controller_update_user_params` modifier instead.",
since: "3.1.0.beta4",
drop_from: "3.2.0",
)
end
end
def fail_with(key)
render json: { success: false, message: I18n.t(key) }
end