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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Kevin Hankens’s picture

Status: Active » Needs review
FileSize
1.18 KB

Patch attached.

philosurfer’s picture

Status: Needs review » Reviewed & tested by the community

Patch works.

Tested Drupal 7.19

greggles’s picture

Status: Reviewed & tested by the community » Fixed

Yep, totally makes sense. Committed! http://drupalcode.org/project/comment_notify.git/commit/ec1ff8f

Thanks for the patch and review.

Status: Fixed » Closed (fixed)

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