diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2017-05-10 11:40:32 +0300 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2017-05-10 11:40:32 +0300 |
commit | d257110e336ae01a7c808246027a0676133dc80f (patch) | |
tree | dfcc05e6e09d39a5fae124c34fd2e4dcf203ccae | |
parent | 3447b44a4a3e325b54ea73d62dfa53bc5ec0a622 (diff) |
Remove redirect for old issue url containing id instead of iid
-rw-r--r-- | app/controllers/projects/issues_controller.rb | 17 | ||||
-rw-r--r-- | changelogs/unreleased/20517-delete-projects-issuescontroller-redirect_old.yml | 4 |
2 files changed, 5 insertions, 16 deletions
diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index bcd23d61519..58d41e0478d 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -227,7 +227,7 @@ class Projects::IssuesController < Projects::ApplicationController def issue # The Sortable default scope causes performance issues when used with find_by - @noteable = @issue ||= @project.issues.where(iid: params[:id]).reorder(nil).take || redirect_old + @noteable = @issue ||= @project.issues.where(iid: params[:id]).reorder(nil).take! end alias_method :subscribable_resource, :issue alias_method :issuable, :issue @@ -266,21 +266,6 @@ class Projects::IssuesController < Projects::ApplicationController end end - # Since iids are implemented only in 6.1 - # user may navigate to issue page using old global ids. - # - # To prevent 404 errors we provide a redirect to correct iids until 7.0 release - # - def redirect_old - issue = @project.issues.find_by(id: params[:id]) - - if issue - redirect_to issue_path(issue) - else - raise ActiveRecord::RecordNotFound.new - end - end - def issue_params params.require(:issue).permit( :title, :assignee_id, :position, :description, :confidential, diff --git a/changelogs/unreleased/20517-delete-projects-issuescontroller-redirect_old.yml b/changelogs/unreleased/20517-delete-projects-issuescontroller-redirect_old.yml new file mode 100644 index 00000000000..1f3ab3a2c10 --- /dev/null +++ b/changelogs/unreleased/20517-delete-projects-issuescontroller-redirect_old.yml @@ -0,0 +1,4 @@ +--- +title: Remove redirect for old issue url containing id instead of iid +merge_request: 11135 +author: blackst0ne |