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,
Comment | File | Size | Author |
---|---|---|---|
#5 | 1833698-5-configurable-default.patch | 2.01 KB | kscheirer |
#3 | 1833698-3-configurable-default.patch | 1.26 KB | kscheirer |
Comments
Comment #1
kscheirerA 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?
Comment #2
ttkaminski CreditAttribution: ttkaminski commentedA configurable variable would work in this case, and much easier to implement too.
Comment #3
kscheirerDoes this work?
Comment #4
ttkaminski CreditAttribution: ttkaminski commentedNeed 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.
Comment #5
kscheirerWell, I guess if you want to be nice to the users... this was just a quick attempt, improvements welcome :)