forum: remove ability to merge forum topics.

* Rarely used (only used ~15 times in total, not used at all since 2015-2016).
* Merging topics didn't properly bump the new topic.
* Merging topics didn't log a modaction when the old topic was deleted.
* Merging topics broke the old topic. Moving all the posts from one topic
  to another leaves the old topic with zero posts. This normally can't
  happen and it causes exceptions when you try to view the empty topic.
* It was technically possible to merge a topic with itself. This would
  break the response_count.
* It was technically possible for a mod to merge a topic into an
  admin-only topic.
This commit is contained in:
evazion
2020-01-19 14:18:54 -06:00
parent 13528ac2d3
commit cca3f98765
6 changed files with 2 additions and 57 deletions

View File

@@ -2,10 +2,9 @@ class ForumTopicsController < ApplicationController
respond_to :html, :xml, :json
respond_to :atom, only: [:index, :show]
before_action :member_only, :except => [:index, :show]
before_action :moderator_only, :only => [:new_merge, :create_merge]
before_action :normalize_search, :only => :index
before_action :load_topic, :only => [:edit, :show, :update, :destroy, :undelete, :new_merge, :create_merge]
before_action :check_min_level, :only => [:show, :edit, :update, :new_merge, :create_merge, :destroy, :undelete]
before_action :load_topic, :only => [:edit, :show, :update, :destroy, :undelete]
before_action :check_min_level, :only => [:show, :edit, :update, :destroy, :undelete]
skip_before_action :api_check
def new
@@ -79,15 +78,6 @@ class ForumTopicsController < ApplicationController
redirect_to forum_topics_path, :notice => "All topics marked as read"
end
def new_merge
end
def create_merge
@merged_topic = ForumTopic.find(params[:merged_id])
@forum_topic.merge(@merged_topic)
redirect_to forum_topic_path(@merged_topic)
end
private
def normalize_search