Project

General

Profile

Strange problem with plugin asset path

Added by Andrew Vit about 14 years ago

I have redmine installed in a sub-URI at /redmine. I installed the redmine_markdown_extra_formatter plugin and I'm trying to figure out why the "Help" link doesn't work. It's generating this URL:

`/redmine/redmine/plugin_assets/redmine_markdown_extra_formatter/help/markdown_extra_syntax.html`

I can't figure out why it's getting the relative root twice. Here's some debugging information I output on the page if anyone has any idea:

Engines::RailsExtensions::AssetHelpers.plugin_asset_path('redmine_markdown_extra_formatter', 'help', 'markdown_extra_syntax.html')
# =>    /redmine/redmine/plugin_assets/redmine_markdown_extra_formatter/help/markdown_extra_syntax.html

ActionController::Base.relative_url_root
# =>    /redmine

Engines.plugins['redmine_markdown_extra_formatter'].public_asset_directory
# =>    plugin_assets/redmine_markdown_extra_formatter

"#{ActionController::Base.relative_url_root}/#{Engines.plugins['redmine_markdown_extra_formatter'].public_asset_directory}" 
# =>    /redmine/plugin_assets/redmine_markdown_extra_formatter

link_to("#{ActionController::Base.relative_url_root}/#{Engines.plugins['redmine_markdown_extra_formatter'].public_asset_directory}")
# =>    /redmine/plugin_assets/redmine_markdown_extra_formatter

Those last two strings are exactly how it's done inside AssetHelpers.plugin_asset_path, but the result is not the same. I also tested link_to, thinking that it might be responsible for altering the URL, but no. I'm wondering if there's some method chaining or some other magic making this happen.

Does anyone have an idea how this is happening? It makes no sense to me.

I'm running redmine 1.0-stable on rails 2.3.5. I have Redmine::Util.relative_url_root set to "/redmine" and Passenger RailsBaseURI = "/redmine"


Replies (1)

RE: Strange problem with plugin asset path - Added by Andrew Vit about 14 years ago

Never mind. I updated to a more recent version on github and all is well. I think the source code that I was looking at locally vs. what was on the server were different... sigh

    (1-1/1)