Currently when you set the notifications state to "No notifications", and the user then clicks the checkbox to enable notifications, the notification state will always be set to "All Comments". This is because in the code, it is hardcoded:

$form['notify_settings']['notify_type'] = array(
    '#type' => 'radios',
    '#options' => $available_options,
    '#default_value' => $preference ? $preference : 1,
  );

Note the default value is set to 1 if notification state is disabled. A simple option would be refector the notification state options as follows:

No Notification::All Comments
No Notification::Replies to my comments
Notification::All Comments
Notification::Replies to my comments

or the section option is to refector the settings into two separate values.

In the meantime, for those of you who want to make "Replies to my comments" the default when notification are initially disabled, then change to above code to:

'#default_value' => $preference ? $preference : 2,

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kscheirer’s picture

Status: Active » Postponed (maintainer needs more info)

A quick fix would be to change those 1's and 2's into a variable, which you could easily override in your settings.php or on the admin config form. Would that work?

ttkaminski’s picture

A configurable variable would work in this case, and much easier to implement too.

kscheirer’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
1.26 KB

Does this work?

ttkaminski’s picture

Need to also update the comment_notify_settings() function to make it configurable, as some users may not know how to set variables through drush or the database.

kscheirer’s picture

Well, I guess if you want to be nice to the users... this was just a quick attempt, improvements welcome :)