ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

URLs for plugin assets do not contain computed rails_asset_id (Bug #481)


Added by Gregor Schmidt at 2011-06-17 03:10 pm. Updated at 2011-06-17 03:20 pm.


Status:Open Start date:2011-06-17
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:Plugin API
Target version:-
Remote issue URL: Affected version:1.4.0

Description

When using the Rails helpers

  • image_path
  • image_tag
  • javascript_include_tag
  • stylesheet_link_tag

with the :plugin option, the generated URLs miss the ?1234321 part - the so called rails_asset_id. This is only happening, when ChiliProject is deployed under a path other than /.

The reason for that is, that the computed asset id is build based on the mtime of the asset. But this mtime cannot be computed, since the asset path already contains the relative__url_root (see Redmine #3935).

I have a plugin that adds tests for this case and fixes the code to correctly attach an asset id. The plugin may be found at https://github.com/finnlabs/chiliproject_proper_plugin_assets.

I propose to port the changes in the plugin to the engines plugin. Though I am not sure, if it is possible to also port the tests. Before doing so, I would like to get some feedback, which way to go.

This bug is most likely present in all versions since Redmine 1.0.2.


History

Updated by Gregor Schmidt at 2011-06-17 03:11 pm

If the rails asset id is set via ENV['RAILS_ASSET_ID'] it is correctly added to the URL.

Updated by Gregor Schmidt at 2011-06-17 03:20 pm

Also - the implementation in that plugin is super hacky and heavily depends on implementation details of Rails' AssetTagHelper.

Also available in: Atom PDF