Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d257110e
Commit
d257110e
authored
May 10, 2017
by
blackst0ne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redirect for old issue url containing id instead of iid
parent
3447b44a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
16 deletions
+5
-16
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+1
-16
changelogs/unreleased/20517-delete-projects-issuescontroller-redirect_old.yml
...d/20517-delete-projects-issuescontroller-redirect_old.yml
+4
-0
No files found.
app/controllers/projects/issues_controller.rb
View file @
d257110e
...
...
@@ -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
,
...
...
changelogs/unreleased/20517-delete-projects-issuescontroller-redirect_old.yml
0 → 100644
View file @
d257110e
---
title
:
Remove redirect for old issue url containing id instead of iid
merge_request
:
11135
author
:
blackst0ne
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment