Bugfix: In redmine 2.3.1.stable, the path to the svg file was absolute but didn't include the path to redmine's root. This meant one would get "/graphs/target-version/1" instead of "/redmine/graphs/target-version/1". This commit fixes the bug by prepending Redmine::Utils.relative_url_root .

This commit is contained in:
Georges Dupéron 2014-01-25 23:53:52 +01:00
parent 286233a1db
commit e54e30b715

View File

@ -3,7 +3,7 @@ class TargetVersionGraphHook < Redmine::Hook::ViewListener
def view_versions_show_bottom(context = { })
if !context[:version].fixed_issues.empty?
output = "<fieldset id='target_version_graph'><legend>#{ l(:label_graphs_total_vs_closed_issues) }</legend>"
output << tag("embed", :width => "100%", :height => 300, :type => "image/svg+xml", :src => url_for(:controller => 'graphs', :action => 'target_version_graph', :id => context[:version]))
output << tag("embed", :width => "100%", :height => 300, :type => "image/svg+xml", :src => File.join(Redmine::Utils.relative_url_root, url_for(:controller => 'graphs', :action => 'target_version_graph', :id => context[:version])))
output << "</fieldset>"
return output
end