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 have a case where reply notifications are enabled for a comment that has no email address entered. If one replies to that comment, comment_notify still calls drupal_mail with an empty "to" email address. Calling drupal_mail with an empty "to" email address causes hook_mail_alter to be called with an empty "to" email address, which causes problems with other modules that expect the address to exist.
Patch attached.
Comment | File | Size | Author |
---|---|---|---|
comment_notify_empty_mail.patch | 587 bytes | emilymoi | |
Comments
Comment #1
emilymoi CreditAttribution: emilymoi commentedComment #3
gregglescomment_notify_empty_mail.patch queued for re-testing.
Comment #4
gregglesCan you explain how that happened? I just want to know so we can add a comment to explain why this check is necessary.
Comment #6
gregglesProbably just needs a reroll - sorry about that.
So, I think that this new check should be split into its own if with a clear comment explaining how it might happen. Having all these conditions stacked together makes it hard to document when/why they might happen.
@bfcam - if you can do that it would be great. Otherwise I'll get around to it sometime :)