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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
dc016fef
Commit
dc016fef
authored
Aug 26, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add redirect from Issue#id to Issue#iid
parent
c8e3d319
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+21
-1
No files found.
app/controllers/projects/issues_controller.rb
View file @
dc016fef
...
...
@@ -91,7 +91,11 @@ class Projects::IssuesController < Projects::ApplicationController
protected
def
issue
@issue
||=
@project
.
issues
.
find_by_iid!
(
params
[
:id
])
@issue
||=
begin
@project
.
issues
.
find_by_iid!
(
params
[
:id
])
rescue
ActiveRecord
::
RecordNotFound
redirect_old
end
end
def
authorize_modify_issue!
...
...
@@ -109,4 +113,20 @@ class Projects::IssuesController < Projects::ApplicationController
def
issues_filtered
@issues
=
Issues
::
ListContext
.
new
(
project
,
current_user
,
params
).
execute
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
project_issue_path
(
@project
,
issue
)
return
else
raise
ActiveRecord
::
RecordNotFound
.
new
end
end
end
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