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.

Attached files in "comment" no longer link to file (Bug #513)


Added by Peter Olson at 2011-07-08 05:59 pm. Updated at 2011-07-12 06:35 am.


Status:Closed Start date:
Priority:Normal Due date:
Assignee:Eric Davis % Done:

0%

Category:Journals / History
Target version:2.1.0
Remote issue URL: Affected version:2.0.0

Description

I just updated to 2.0 and noticed none of my attached files link to the file in a "comment" or "update".

See the attached image.


cp2-filesnotlink.png (24.7 kB) Peter Olson, 2011-07-08 05:59 pm


Associated revisions

Revision dd6d9d1c
Added by Eric Davis at 2011-07-12 03:33 am

[#513] Fix links to attachments in the issue history

History

Updated by Eric Davis at 2011-07-08 06:12 pm

Are those from pre-2.0 or were they posted after you upgraded?

  • Priority changed from High to Normal
  • (deleted custom field) set to 2.0.0
  • Status changed from Open to Needs more information

Updated by Peter Olson at 2011-07-08 06:15 pm

The ones in that image were after the upgrade (I upgraded yesterday and those were posted this morning), but the old ones look the same.

  • Status changed from Needs more information to Open

Updated by Peter Olson at 2011-07-08 06:28 pm

Also, I went straight from 1.2.0 to 2.0 in the upgrade. Maybe that will help.

Updated by Peter Olson at 2011-07-08 06:36 pm

From our convo via IRC:

that0n3guy: open the issue page, view the source for the page and look for that note, it will be in a div like "<div id='change-2254'". The number part is the journal id.

ok I'll look

edavis10: change-1790

that0n3guy: run this:

ruby script/runner -e production "puts Journal.find(1790).inspect"

here is my info:

NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /srv/www/chiliproject/lockfile/ruby/1.8/gems/rails-2.3.12/lib/rails/gem_dependency.rb:21.
#<IssueJournal id: 1790, journaled_id: 258, user_id: 3, notes: "Cory,\r\n\r\nDevelopment is going well.  We need to pic...", created_at: "2011-07-08 15:09:13", version: 12, activity_type: "issues", changes: {"attachments38"=>[nil, "creative-frontpage.png"], "attachments39"=>[nil, "flex-frontpage.png"], "attachments40"=>[nil, "flex-fullproducts.png"], "attachments41"=>[nil, "flex-catalog-grid.png"]}, type: "IssueJournal">

Updated by Felix Schäfer at 2011-07-11 11:25 pm

The issue is here source:/vendor/plugins/acts_as_journalized/lib/journal_formatter.rb#L91, the link_to_attachment breaks there because it can't find url_for. I've tried including ActionView::Helpers::UrlHelper at different places, the problem is that that in turn breaks the first thing that uses url_for in the view (in this case source:/app/views/issues/_action_menu.rhtml#L2).

I guess this is one of the edgier cases of rails-usage, maybe Eric or Tim have an idea?

  • Target version set to 2.1.0
  • Category set to Journals / History

Updated by Eric Davis at 2011-07-12 01:35 am

Fixed in dd6d9d1.

Felix: if you ever run into problems with using url_for in lib/ or vendor/, look at how the ViewHookListener does it. I've refined that over the years to work as close as possible to an actual view.

  • Assignee set to Eric Davis
  • Status changed from Open to Closed

Updated by Felix Schäfer at 2011-07-12 06:35 am

Eric Davis wrote:

Felix: if you ever run into problems with using url_for in lib/ or vendor/, look at how the ViewHookListener does it. I've refined that over the years to work as close as possible to an actual view.

I'll try to remember it, thanks for the tip :-)

Also available in: Atom PDF