From 58a63c49c49bfdde9ad1d5db5157662ca60c2c8e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 3 Jan 2014 14:42:15 +0000 Subject: Fixed that magic links to existing attachments are not converted when previewing issue notes. git-svn-id: http://svn.redmine.org/redmine/trunk@12476 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/helpers') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index fac002565..bb7208e36 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -847,7 +847,8 @@ module ApplicationHelper repo_prefix = nil end when 'attachment' - attachments = options[:attachments] || (obj && obj.respond_to?(:attachments) ? obj.attachments : nil) + attachments = options[:attachments] || [] + attachments += obj.attachments if obj.respond_to?(:attachments) if attachments && attachment = Attachment.latest_attach(attachments, name) link = link_to_attachment(attachment, :only_path => only_path, :download => true, :class => 'attachment') end -- cgit v1.2.3