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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greggles’s picture

Title: Anonymous checkbox but no email box » Require site admins to enable the input of e-mails.
Priority: Minor » Normal

Good 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.

greggles’s picture

Version: 5.x-2.0 » 5.x-2.x-dev
Status: Active » Needs review
FileSize
1.79 KB
1.5 KB

So, 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.

bchoc’s picture

Title: Require site admins to enable the input of e-mails. » Anonymous checkbox but no email box
Version: 5.x-2.x-dev » 5.x-2.0
Priority: Normal » Minor
Status: Needs review » Active

Perhaps, 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.

greggles’s picture

Title: Anonymous checkbox but no email box » Help site admins get configuration right and remove notification checkbox for anonymous if there is no email box

Yeah, that's a great idea. I'll do both :)

greggles’s picture

Assigned: Unassigned » greggles
Status: Active » Fixed

Ok...I've just committed a patch which does both.

Thanks again Brian.

http://drupal.org/cvs?commit=135485
http://drupal.org/cvs?commit=135484

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

greggles’s picture

Attached patch reduces the warnings if comment notify is disabled for a content type.