From 7940158505d8b2ea4ab70f84c6a1cd6bdf873a29 Mon Sep 17 00:00:00 2001 From: Takayuki SHIMIZUKAWA Date: Tue, 19 Feb 2013 13:34:59 +0900 Subject: [PATCH] fix wikitoolbar help url when redmine on subpath. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit if `Redmine::Utils.relative_url_root` return subpath, wikitoolbar_for method return wrong URL. ex. relative_url_root == '/redmine', wikitoolbar_for() return '/redmine/redmine/plugin_assets/redmine_restructuredtext_formatter/help/restructuredtext_syntax.html'. `Engines::RailsExtensions::AssetHelpers.plugin_asset_path` already include `relative_url_root` at  https://github.com/redmine/redmine/commit/ebb445c36468529cc7873136469a6162660ad253 . --- app/helpers/redmine_restructuredtext_formatter/helper.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/helpers/redmine_restructuredtext_formatter/helper.rb b/app/helpers/redmine_restructuredtext_formatter/helper.rb index aeb18bd..766224a 100644 --- a/app/helpers/redmine_restructuredtext_formatter/helper.rb +++ b/app/helpers/redmine_restructuredtext_formatter/helper.rb @@ -4,8 +4,7 @@ module Helper def wikitoolbar_for(field_id) heads_for_wiki_formatter - url = Redmine::Utils.relative_url_root + - Engines::RailsExtensions::AssetHelpers.plugin_asset_path('redmine_restructuredtext_formatter', 'help', 'restructuredtext_syntax.html') + url = Engines::RailsExtensions::AssetHelpers.plugin_asset_path('redmine_restructuredtext_formatter', 'help', 'restructuredtext_syntax.html') help_link = l(:setting_text_formatting) + ': ' + link_to(l(:label_help), url, :onclick => "window.open(\"#{url}\", \"\", \"resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes\"); return false;")