Commit 957a0e45 authored by Marin Jankovski's avatar Marin Jankovski Committed by Marin Jankovski

Merge branch 'issues-tracker-id' into 'master'

Properly move over `issues_tracker_id` from old custom issue tracker URLs.

Addresses https://gitlab.com/gitlab-org/gitlab-ce/issues/1124.

cc @marin Regression in 7.8.0.

See merge request !1670
parent abea0701
...@@ -55,9 +55,9 @@ class IssueTrackerService < Service ...@@ -55,9 +55,9 @@ class IssueTrackerService < Service
if enabled_in_gitlab_config if enabled_in_gitlab_config
self.properties = { self.properties = {
title: issues_tracker['title'], title: issues_tracker['title'],
project_url: set_project_url, project_url: add_issues_tracker_id(issues_tracker['project_url']),
issues_url: issues_tracker['issues_url'], issues_url: add_issues_tracker_id(issues_tracker['issues_url']),
new_issue_url: issues_tracker['new_issue_url'] new_issue_url: add_issues_tracker_id(issues_tracker['new_issue_url'])
} }
else else
self.properties = {} self.properties = {}
...@@ -100,15 +100,15 @@ class IssueTrackerService < Service ...@@ -100,15 +100,15 @@ class IssueTrackerService < Service
Gitlab.config.issues_tracker[to_param] Gitlab.config.issues_tracker[to_param]
end end
def set_project_url def add_issues_tracker_id(url)
if self.project if self.project
id = self.project.issues_tracker_id id = self.project.issues_tracker_id
if id if id
issues_tracker['project_url'].gsub(":issues_tracker_id", id) url = url.gsub(":issues_tracker_id", id)
end end
end end
issues_tracker['project_url'] url
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment