Skip to content
Snippets Groups Projects
Commit 13a16363 authored by blackst0ne's avatar blackst0ne
Browse files

Remove redirect for old issue url containing id instead of iid

Former-commit-id: d257110e
parent 3da6cbd1
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
@@ -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,
Loading
Loading
---
title: Remove redirect for old issue url containing id instead of iid
merge_request: 11135
author: blackst0ne
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment