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
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | notifications_files.module.list_.patch | 1.06 KB | Barberousse |
Comments
Comment #1
danepowell commentedI 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!
Comment #2
Barberousse commentedHello,
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
Comment #3
Barberousse commentedHello,
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
Comment #4
danepowell commentedThanks for the patch! Is there anything else (besides checking the list property) that needs to get fixed on the notifications_files side of things?
Comment #5
Barberousse commentedThere 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
Comment #6
danepowell commentedI 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).
Comment #7
danepowell commentedJust 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.
Comment #8
danepowell commentedJust 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.
Comment #9
danepowell commentedComment #10
Barberousse commentedHello,
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
Comment #11
danepowell commentedLooks like we're just waiting on #854580: hook_notifications_message_alter() never called because method message_build() should be renamed build() now
Comment #12
danepowell commentedI'm going to close this, because there is nothing else that needs to get fixed in this module.