Commit e5c97101 authored by Artem Sidorenko's avatar Artem Sidorenko

Use the relative url prefix for links in Wiki

parent 5e130c3e
...@@ -52,6 +52,9 @@ v 8.8.0 (unreleased) ...@@ -52,6 +52,9 @@ v 8.8.0 (unreleased)
- Hide left sidebar on phone screens to give more space for content - Hide left sidebar on phone screens to give more space for content
- Redesign navigation for profile and group pages - Redesign navigation for profile and group pages
v 8.7.6
- Fix links on wiki pages for relative url setups. !4131 (Artem Sidorenko)
v 8.7.5 v 8.7.5
- Fix relative links in wiki pages. !4050 - Fix relative links in wiki pages. !4050
- Fix always showing build notification message when switching between merge requests !4086 - Fix always showing build notification message when switching between merge requests !4086
......
...@@ -40,7 +40,7 @@ class ProjectWiki ...@@ -40,7 +40,7 @@ class ProjectWiki
end end
def wiki_base_path def wiki_base_path
["/", @project.path_with_namespace, "/wikis"].join('') [Gitlab.config.gitlab.relative_url_root, "/", @project.path_with_namespace, "/wikis"].join('')
end end
# Returns the Gollum::Wiki object. # Returns the Gollum::Wiki object.
......
...@@ -62,7 +62,7 @@ module Gitlab ...@@ -62,7 +62,7 @@ module Gitlab
end end
def wiki_page_url 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 end
end end
...@@ -38,7 +38,8 @@ describe ProjectWiki, models: true do ...@@ -38,7 +38,8 @@ describe ProjectWiki, models: true do
describe "#wiki_base_path" do describe "#wiki_base_path" do
it "returns the 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) expect(subject.wiki_base_path).to eq(wiki_base_path)
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