From 76842aac754e2355c34e751002fcbb1e8187e344 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 10 Mar 2015 14:06:15 +0100 Subject: [PATCH] Properly move over `issues_tracker_id` from old custom issue tracker URLs. --- app/models/project_services/issue_tracker_service.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/project_services/issue_tracker_service.rb b/app/models/project_services/issue_tracker_service.rb index 16876335b67..0c734a544d2 100644 --- a/app/models/project_services/issue_tracker_service.rb +++ b/app/models/project_services/issue_tracker_service.rb @@ -60,9 +60,9 @@ class IssueTrackerService < Service if enabled_in_gitlab_config self.properties = { title: issues_tracker['title'], - project_url: set_project_url, - issues_url: issues_tracker['issues_url'], - new_issue_url: issues_tracker['new_issue_url'] + project_url: add_issues_tracker_id(issues_tracker['project_url']), + issues_url: add_issues_tracker_id(issues_tracker['issues_url']), + new_issue_url: add_issues_tracker_id(issues_tracker['new_issue_url']) } else self.properties = {} @@ -111,15 +111,15 @@ class IssueTrackerService < Service Gitlab.config.issues_tracker[to_param] end - def set_project_url + def add_issues_tracker_id(url) if self.project id = self.project.issues_tracker_id if id - issues_tracker['project_url'].gsub(":issues_tracker_id", id) + url = url.gsub(":issues_tracker_id", id) end end - issues_tracker['project_url'] + url end end