Actions
Defect #38697
closedException during thumbnail macro to image tag conversion in emails
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Affected version:
Description
Example of the error message displayed in the email:
Error executing the thumbnail macro (undefined method `controller_name' for #<Mailer:0x0001d21f88db58> Did you mean? controller_path)
This started happening after Issue #37379 was addressed.
And, I have created a patch, please check it out.
Best regards.
Files
Related issues
Updated by Go MAEDA over 1 year ago
- Target version set to Candidate for next minor release
Here is a decoded content of fix.patch. Since ActionMailer::Base
has controller_path
method (https://api.rubyonrails.org/v6.1/classes/ActionMailer/Base.html#method-c-controller_path), the fix should work as expected.
--- a/lib/redmine/wiki_formatting/macros.rb
+++ b/lib/redmine/wiki_formatting/macros.rb
@@ -281,7 +281,7 @@ module Redmine
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?
+ if (controller_path == 'previews' || action_name == 'preview') && @attachments.present?
attachments = (attachments.to_a + @attachments).compact
end
if attachments.present? && (attachment = Attachment.latest_attach(attachments, filename))
Updated by Go MAEDA about 1 year ago
- Related to Defect #37379: Thumbnail macro does not work when a file is attached and preview is displayed immediately added
Updated by Mizuki ISHIKAWA about 1 year ago
- File add-test.patch add-test.patch added
Thank you for fixing the issue. I have attached a patch that adds a test case which fails before the fix and passes after the fix is applied.
Updated by Go MAEDA about 1 year ago
- Subject changed from If the email notification contains a thumbnail, the error message `undefined method `controller_name'` is displayed. to Exception during thumbnail macro to image tag conversion in emails
- Status changed from New to Closed
- Assignee set to Go MAEDA
Committed the fix. Thank you.
Updated by Go MAEDA about 1 year ago
- Target version changed from Candidate for next minor release to 4.2.11
Actions