diff options
author | Go MAEDA <maeda@farend.jp> | 2022-12-30 09:00:14 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2022-12-30 09:00:14 +0000 |
commit | eb399b83a500f77469011cc27da0b0cf15ec3937 (patch) | |
tree | 94761434ba11a31c57975e86a539d6bb5054ca0d /lib/redmine | |
parent | b7078d78dd56218744c691bd68f89548a7bbfa9d (diff) | |
download | redmine-eb399b83a500f77469011cc27da0b0cf15ec3937.tar.gz redmine-eb399b83a500f77469011cc27da0b0cf15ec3937.zip |
Fix `{{thumbnail}}` macro in an issue note cannot fetch an image attached in a different note (#37881).
Patch by Mizuki ISHIKAWA.
git-svn-id: https://svn.redmine.org/redmine/trunk@22012 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine')
-rw-r--r-- | lib/redmine/wiki_formatting/macros.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/redmine/wiki_formatting/macros.rb b/lib/redmine/wiki_formatting/macros.rb index 42096b9a3..9fbed6a6e 100644 --- a/lib/redmine/wiki_formatting/macros.rb +++ b/lib/redmine/wiki_formatting/macros.rb @@ -279,7 +279,8 @@ module Redmine size = size.to_i size = 200 unless size > 0 - attachments = obj.attachments if obj.respond_to?(:attachments) + container = obj.is_a?(Journal) ? obj.journalized : obj + attachments = container.attachments if container.respond_to?(:attachments) if (controller_name == 'previews' || action_name == 'preview') && @attachments.present? attachments = (attachments.to_a + @attachments).compact end |