Hello,

I use some custom subscriptions (mainly content type), and I want attached files to be sent with new topics and new comments notifications, but I never managed to make it work with notifications files 6.x-4.x-dev or 6.x-4.0-beta4.

I set up for each content type to send attachements by default with node and to include by default attachements that come with comments.

Do you have any hint on how I could debug this issue ?

Mime mail 6.x-1.0-alpha4, Messaging 6.x-4.0-beta6, Notifications 6.x-4.0-beta6

Thank you.

Best regards.

Guillaume

Comments

danepowell’s picture

Status: Active » Postponed

I apologize that I can't debug this right now as I am waiting on some other blocking issues to upgrade to 4.x myself - Jose adapted the 4.x version of this module. I also didn't code the support for Mime Mail, only PHP Mailer. However, I can give you some general tips- if this is a development environment, I'd highly recommend getting Krumo and sprinkling a number of krumo($variable) statements throughout the relevant modules (you can also use print_r if you don't want to install Krumo, or watchdog('debug', print_r($variable, TRUE)) if this is on a production server).

I'd start by making sure that the fids are getting attached to the event in hook_notifications_event, then make sure they are making it to hook_message_alter and the corresponding files are getting attached to the message, and finally make sure that the files actually get pulled up in the mime_mail module when it calls $message->get_files(). Then try to narrow it down from there... good luck!

Barberousse’s picture

Hello,

Thank you for your answer.

I already played a bit with print_r. Right now, it seems that the "notifications_files_notifications_message_alter" is never called. I must understand why...

Best regards.

Guillaume

Barberousse’s picture

StatusFileSize
new1.06 KB

Hello,

I found two errors: first in notifications_files.module: mimemail will send only attachments with property list = 1.

Another one in notifications, I will create a separate thread.

Best regards.

Guillaume

danepowell’s picture

Status: Postponed » Needs review

Thanks for the patch! Is there anything else (besides checking the list property) that needs to get fixed on the notifications_files side of things?

Barberousse’s picture

Title: No files sent with Mimemail sending method » No sent files sent with mimemail and notifications files
Status: Postponed » Needs review

There is nothing to add on the notifications_files side, but this patch on notifications module is needed too : #854580: hook_notifications_message_alter() never called because method message_build() should be renamed build()

By the way, I made the patch the quick and dirty way, to do it a more standard way, I think we should merge the files table with the upload table, the comment_uploads and the filefield table and populate the "$files[$file->fid]" with the obtained db object, but I'm not a SQL expert and I was tired...

But I'm glad if this patch helps you, I really enjoy Drupal and all the modules community.

Guillaume

danepowell’s picture

I think your patch is just fine given the current architecture. We already query the various modules once at notification-event-generation time to get the list of fids- I don't want to query them all again at message-generation time just to get the "list" parameter. In fact, one could argue that it's a MIME mail module bug to even pay attention to this parameter, since it's not part of the core file object (but rather specific to node attachments/uploads).

danepowell’s picture

Status: Needs review » Postponed

Just FYI, I think this patch for MIME mail actually might fix this problem. I'd prefer to see that happen than try to support a non-standard.
#629038: Attachements dont respect ‘list’ setting.

danepowell’s picture

Just to reiterate, this will be solved faster if people can test the patch in the MIME Mail queue and report both here and in that issue that it solves the problem.

danepowell’s picture

Title: No sent files sent with mimemail and notifications files » No files sent with Mimemail sending method
Barberousse’s picture

Hello,

I removed the patch I made in this thread and used only these patches:

#629038: Attachements dont respect ‘list’ setting. and #854580: hook_notifications_message_alter() never called because method message_build() should be renamed build()

I confirm that it corrects the bug too.

Guillaume

danepowell’s picture

Title: No sent files sent with mimemail and notifications files » No files sent with Mimemail sending method
Status: Needs review » Postponed
danepowell’s picture

Status: Postponed » Fixed

I'm going to close this, because there is nothing else that needs to get fixed in this module.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.