https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292010-05-05T11:58:53ZRedmineRedmine - Defect #3935: stylesheet_link_tag with plugin doesn't take into account relative_url_roothttps://www.redmine.org/issues/3935?journal_id=164652010-05-05T11:58:53ZJérémie Delaitre
<ul></ul><p>This duplicates <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: stylesheet_link_tag does not honor Redmine running out of a sub-uri if it is called from a plugin (Closed)" href="https://www.redmine.org/issues/5021">#5021</a></p> Redmine - Defect #3935: stylesheet_link_tag with plugin doesn't take into account relative_url_roothttps://www.redmine.org/issues/3935?journal_id=188932010-08-02T15:41:11ZDaniel S
<ul></ul><pre>
--- vendor/plugins/engines/lib/engines/rails_extensions/asset_helpers.rb~ 2010-08-02 17:40:47.000000000 +0200
+++ vendor/plugins/engines/lib/engines/rails_extensions/asset_helpers.rb 2010-08-02 17:40:47.000000000 +0200
@@ -109,7 +109,7 @@ module Engines::RailsExtensions::AssetHe
# Returns the publicly-addressable relative URI for the given asset, type and plugin
def self.plugin_asset_path(plugin_name, type, asset)
raise "No plugin called '#{plugin_name}' - please use the full name of a loaded plugin." if Engines.plugins[plugin_name].nil?
- "/#{Engines.plugins[plugin_name].public_asset_directory}/#{type}/#{asset}"
+ "#{ActionController::Base.relative_url_root}/#{Engines.plugins[plugin_name].public_asset_directory}/#{type}/#{asset}"
end
end
</pre> Redmine - Defect #3935: stylesheet_link_tag with plugin doesn't take into account relative_url_roothttps://www.redmine.org/issues/3935?journal_id=196012010-08-21T17:40:33ZNick Bolton
<ul></ul><p>As a workaround, I used the following (more verbose) code (for example, in a hook):</p>
<pre>
class EventNotificationOverrideViewer < Redmine::Hook::ViewListener
def view_layouts_base_html_head(context = { })
javascript_include_tag "#{ActionController::Base.relative_url_root}/#{Engines.plugins['my_plugin'].public_asset_directory}/javascripts/somejs"
end
end
</pre> Redmine - Defect #3935: stylesheet_link_tag with plugin doesn't take into account relative_url_roothttps://www.redmine.org/issues/3935?journal_id=200812010-09-08T07:45:56ZGo MAEDA
<ul></ul><p>Daniel S's patch works fine with Redmine 1.0.1 (deployed in a subdirectory) and Projects Tree View plugin (<a class="external" href="http://github.com/MischaTheEvil/projects_tree_view">http://github.com/MischaTheEvil/projects_tree_view</a>).</p>
<p>I wish this issue would be fixed in 1.0.2.</p> Redmine - Defect #3935: stylesheet_link_tag with plugin doesn't take into account relative_url_roothttps://www.redmine.org/issues/3935?journal_id=202442010-09-13T18:13:16ZJérémie Delaitre
<ul></ul><p>I just tried Daniel S's patch on a bitnami stack (redmine 1.0.1) and the redmine_time_tracker plugin (<a class="external" href="http://github.com/delaitre/redmine_time_tracker">http://github.com/delaitre/redmine_time_tracker</a> (master branch)) and it works fine too.</p> Redmine - Defect #3935: stylesheet_link_tag with plugin doesn't take into account relative_url_roothttps://www.redmine.org/issues/3935?journal_id=204062010-09-17T04:04:45ZEric Davis
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Target version</strong> set to <i>1.0.2</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>I have a <a href="http://github.com/edavis10/engines" class="external">fork of Engines</a> now where I've added this fix to the plugin and also another fix that was floating around on Redmine. Fixed in <a class="changeset" title="Use the relative_url_root when generating asset_paths. #3935 Contributed by Daniel S from Redmine." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/4094">r4094</a> for Redmine.</p> Redmine - Defect #3935: stylesheet_link_tag with plugin doesn't take into account relative_url_roothttps://www.redmine.org/issues/3935?journal_id=204902010-09-20T03:51:30ZEric Davis
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul><p>Merged into 1.0-stable for release in 1.0.2</p>