Exception during thumbnail macro to image tag conversion in emails
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.
- Target version set to Candidate for next minor release
Here is a decoded content of fix.patch. Since
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))
- 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.