Merge branch 'wiki-fix-reloaded' into 'master'

Use the relative url prefix for links in Wiki

Retry of gitlab-org/gitlab-ce!4026

@rymai !4050 solved all other problems how it looks like. I [tested](ff01eca7b5/builds) this with ruby22

Fixes #17071 



See merge request !4131
This commit is contained in:
Rémy Coutable 2016-05-16 20:30:42 +00:00
commit 4f66799738
4 changed files with 7 additions and 3 deletions

View file

@ -57,6 +57,9 @@ v 8.8.0 (unreleased)
- Add counter metrics for rails cache
- Import pull requests from GitHub where the source or target branches were removed
v 8.7.6
- Fix links on wiki pages for relative url setups. !4131 (Artem Sidorenko)
v 8.7.5
- Fix relative links in wiki pages. !4050
- Fix always showing build notification message when switching between merge requests !4086

View file

@ -40,7 +40,7 @@ class ProjectWiki
end
def wiki_base_path
["/", @project.path_with_namespace, "/wikis"].join('')
[Gitlab.config.gitlab.relative_url_root, "/", @project.path_with_namespace, "/wikis"].join('')
end
# Returns the Gollum::Wiki object.

View file

@ -62,7 +62,7 @@ module Gitlab
end
def wiki_page_url
"#{Gitlab.config.gitlab.url}#{object.wiki.wiki_base_path}/#{object.slug}"
namespace_project_wiki_url(object.wiki.project.namespace, object.wiki.project, object.slug)
end
end
end

View file

@ -38,7 +38,8 @@ describe ProjectWiki, models: true do
describe "#wiki_base_path" do
it "returns the wiki base path" do
wiki_base_path = "/#{project.path_with_namespace}/wikis"
wiki_base_path = "#{Gitlab.config.gitlab.relative_url_root}/#{project.path_with_namespace}/wikis"
expect(subject.wiki_base_path).to eq(wiki_base_path)
end
end