From 705217d33717a00650d38840ec94acfb392b91fb Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 25 Oct 2018 23:00:43 -0500 Subject: [PATCH] Fix new dtext shortlinks redirecting to nonexistent pages. Fix the following dtext shortlinks redirecting to nonexistent pages: * flag #1 * appeal #1 * mod action #1 * bur #1 --- app/controllers/bulk_update_requests_controller.rb | 4 +++- app/controllers/mod_actions_controller.rb | 7 +++++++ app/controllers/post_appeals_controller.rb | 4 +++- app/controllers/post_flags_controller.rb | 4 +++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/app/controllers/bulk_update_requests_controller.rb b/app/controllers/bulk_update_requests_controller.rb index bac8a2a92..59793447d 100644 --- a/app/controllers/bulk_update_requests_controller.rb +++ b/app/controllers/bulk_update_requests_controller.rb @@ -15,7 +15,9 @@ class BulkUpdateRequestsController < ApplicationController end def show - respond_with(@bulk_update_request) + respond_with(@bulk_update_request) do |fmt| + fmt.html { redirect_to bulk_update_requests_path(search: { id: @bulk_update_request.id }) } + end end def edit diff --git a/app/controllers/mod_actions_controller.rb b/app/controllers/mod_actions_controller.rb index d48071189..db302ab34 100644 --- a/app/controllers/mod_actions_controller.rb +++ b/app/controllers/mod_actions_controller.rb @@ -5,4 +5,11 @@ class ModActionsController < ApplicationController @mod_actions = ModAction.search(search_params).paginate(params[:page], :limit => params[:limit]) respond_with(@mod_actions) end + + def show + @mod_action = ModAction.find(params[:id]) + respond_with(@mod_action) do |fmt| + fmt.html { redirect_to mod_actions_path(search: { id: @mod_action.id }) } + end + end end diff --git a/app/controllers/post_appeals_controller.rb b/app/controllers/post_appeals_controller.rb index 116c94030..d775e1bec 100644 --- a/app/controllers/post_appeals_controller.rb +++ b/app/controllers/post_appeals_controller.rb @@ -24,7 +24,9 @@ class PostAppealsController < ApplicationController def show @post_appeal = PostAppeal.find(params[:id]) - respond_with(@post_appeal) + respond_with(@post_appeal) do |fmt| + fmt.html { redirect_to post_appeals_path(search: { id: @post_appeal.id }) } + end end private diff --git a/app/controllers/post_flags_controller.rb b/app/controllers/post_flags_controller.rb index 5e3add7ef..19d205a94 100644 --- a/app/controllers/post_flags_controller.rb +++ b/app/controllers/post_flags_controller.rb @@ -24,7 +24,9 @@ class PostFlagsController < ApplicationController def show @post_flag = PostFlag.find(params[:id]) - respond_with(@post_flag) + respond_with(@post_flag) do |fmt| + fmt.html { redirect_to post_flags_path(search: { id: @post_flag.id }) } + end end private