Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I cant seem to find what commit caused the regression but between my last 6.x-1.x-dev release on Monday, June 8th 2009, 12:22:18 (GMT) [1244463738] and 6.x-1.0-alpha1 mimemail stopped respecting if an node file attachment should be ‘attached’ to the email.
Comment | File | Size | Author |
---|---|---|---|
#10 | mimemail.629038_02.patch | 652 bytes | sgabe |
#3 | mimemail.629038_01.patch | 766 bytes | sgabe |
#1 | mimemail-629038.patch | 901 bytes | Jackinloadup |
Comments
Comment #1
Jackinloadup CreditAttribution: Jackinloadup commentedThis patch against 6.x-1.x-dev fixed this.
Was this on purpose?
Comment #2
sgabe CreditAttribution: sgabe commentedI applied your patch on 6.x-1.0-alpha1, tested it and works fine, so I am marking this as RTBC.
Comment #3
sgabe CreditAttribution: sgabe commentedRevised patch against HEAD.
Comment #4
sgabe CreditAttribution: sgabe commentedCommitted to HEAD.
Comment #6
louiswolf CreditAttribution: louiswolf commentedWhat is the purpose of the list parameter? If FALSE, my attachments are ignored but why would I want to do that?
I can't find any documentation.
Comment #7
sgabe CreditAttribution: sgabe commentedLet's say you upload an image using the Upload module and place that picture in the body to embed it in the message. If we don't check the list parameter the image will be attached twice. First Mime Mail will extract and embed the image placed in the body source and then attach it again because it is in the attachments too. The list parameter allows the user to upload something without attaching it to the message. I know probably this is not the usual case, because most users (hopefully) use ImageField, but it does exist.
Comment #8
Robbert CreditAttribution: Robbert commentedI'm also confused by the purpose of this parameter. If I understand it correctly, we need the
list
parameter in order to filter the array of attachments given to mimemail by another module (Upload in this case)? Why is it mimemail's job to filter attachments and why can't other modules just filter attachments themselves? (Or am I completely wrong?)I have various modules that use mimemail to send mails. In these modules I just call the function
mimemail
, and when needed specify attachments with an array of the following shape (as listed in the documentation of the function):But because of
if($a->list)
all my attachments are being ignored unless I use an array of the following shape:So, either this behavior should be documented or other modules should filter attachments themselves and this check should be removed.
Edit: just another possibility, instead of
if($a->list)
we could useif(!isset($a->list) || $a->list)
, that way attachments are not ignored if the field isn't specified at all.Comment #9
sgabe CreditAttribution: sgabe commentedSince Upload is a core module IMHO we should conform to it. However, I agree this lacks documentation which should be covered in #614782: Update README.txt and additional documentation and of course updated in the
mimemail_prepare_message()
function's parameter description. This will be fixed in the next release.Comment #10
sgabe CreditAttribution: sgabe commentedI didn't see your update Robert, but I thought the same thing. I am attaching a patch with this modification what is hopefully acceptable for everyone.
Comment #11
Dane Powell CreditAttribution: Dane Powell commentedI would like to see #10 committed, since the list parameter is not part of the core file object and is not always specified - for instance, Notifications Files does not work with MIME mail because it doesn't set the list parameter (and has no reason to):
#853308: No files sent with Mimemail sending method
Comment #12
Barberousse CreditAttribution: Barberousse commentedHello,
I removed the patch I made in here: #853308: No files sent with Mimemail sending method and instead I used the patch #10 and the one provided here: #854580: hook_notifications_message_alter() never called because method message_build() should be renamed build() and it corrects the issue #853308: No files sent with Mimemail sending method
Guillaume
Comment #13
Dane Powell CreditAttribution: Dane Powell commentedExcellent- would love to see this committed, as would many users of Notifications Files I'm sure...
Comment #14
sgabe CreditAttribution: sgabe commentedCommitted to HEAD.
Comment #15
Dane Powell CreditAttribution: Dane Powell commentedThanks!