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.
If in /admin/content/comment/settings "Anonymous posters may not enter their contact information" is checked and this module is turned on, the result is that an anonymous used may be informed "If you want to subscribe to comments you must supply a valid e-mail address" when there is actually no box into which to type the email address.
Obviously, this is not a bright thing for an admin to do, but I think an admin alert on the settings page might be a nice touch, or not showing the checkbox if an email box is not shown.
Comment | File | Size | Author |
---|---|---|---|
#7 | 296549_less_warnings_please.patch | 1.42 KB | greggles |
#2 | 296549_5x_comment_notify_anon_leave_mail.patch | 1.5 KB | greggles |
#2 | 296549_6x_comment_notify_anon_leave_mail.patch | 1.79 KB | greggles |
Comments
Comment #1
gregglesGood point. The way the module is now written it's possible to get into this weird condition. I believe there should be a hook_requirements showing this problem and alerting site admins that this is a bad configuration.
Comment #2
gregglesSo, it turns out that this is kind of tricky. It's possible that this is a reasonable thing for an admin to do, because maybe they don't want anonymous to have the ability to subscribe to comments on a particular content type or something.
Anyway, to avoid all the craziness of possible configuration settings I've just added a message that says what's going on and provides a link to the place to fix it.
There are two patches - one for 5.x-2.x and one for 6.x. For 5.x it's slightly easier since those comment settings are on one screen rather than a whole bunch of screens.
Comment #3
bchoc CreditAttribution: bchoc commentedPerhaps, then, it would make more sense to apply the logic:
IF the user is anonymous AND IF the email box is turned off THEN don't display the checkbox at all.
I'll try the patch out.
Comment #4
gregglesYeah, that's a great idea. I'll do both :)
Comment #5
gregglesOk...I've just committed a patch which does both.
Thanks again Brian.
http://drupal.org/cvs?commit=135485
http://drupal.org/cvs?commit=135484
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
gregglesAttached patch reduces the warnings if comment notify is disabled for a content type.