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.
Greetings! I just noticed an issue where a user's configuration does not override the default behavior for node_notify.
The variable node_notify_default_mailalert is set to 1, but the user has unchecked the option for node_notify. This means that the user's object looks like:
["comment_notify_settings"]=>
object(stdClass)#240 (3) {
["uid"]=>
string(5) "21506"
["node_notify"]=>
string(1) "0"
["comment_notify"]=>
string(1) "0"
}
Then in _comment_notify_mailalert (line 469) it checks to see if it should use the user's setting or the site default. However, the conditional checks empty() on the user setting which evaluates to true if the user has set node_notify to "0". In this case, it ends up using the node_notify_default_mailalert value instead.
Comment | File | Size | Author |
---|---|---|---|
#1 | comment_notify_node_notify_override_1911870_1.patch | 1.18 KB | Kevin Hankens |
Comments
Comment #1
Kevin Hankens CreditAttribution: Kevin Hankens commentedPatch attached.
Comment #2
philosurfer CreditAttribution: philosurfer commentedPatch works.
Tested Drupal 7.19
Comment #3
gregglesYep, totally makes sense. Committed! http://drupalcode.org/project/comment_notify.git/commit/ec1ff8f
Thanks for the patch and review.