On normal comments, when you enable anonymous posting, you are only required to fill in the name and email. But with node comments, it also requires the homepage. Is there any way to change this?

You can set it so ALL of the fields are not required, but I don't want to do that.

Thanks!

CommentFileSizeAuthor
#1 nodecomment_fields.patch5.33 KBsndev

Comments

sndev’s picture

Version: 5.x-1.1 » 6.x-2.x-dev
Category: bug » feature
Status: Active » Needs review
StatusFileSize
new5.33 KB

Here is a patch that allows selection of individual anonymous fields from admin settings.

Narretz’s picture

Hi sndev,

Thanks for the patch!
I just tried it with Beta3. Unfortunately, not all hunks succeeded. These are the failure messages I got:

Hunk #1 failed at 46
Hunk #2 failed at 141
Hunk #3 succeeded at 400 with fuzz 2 (offset 155 lines)

If you could look into that, I'd be happy to review / test the patch again, so the next release can (hopefully) include it.
It seems it has something to do with nodecomments .2 beta getting its definitions from comments.module instead of defining them itself.

EDIT:
A very quick way to make homepage optional:

in nodecomment.module, line 406/407: delete / comment out:
,
'#required' => ($anon_meta_info == COMMENT_ANONYMOUS_MUST_CONTACT)

The same is possible for name and email.

Narretz’s picture

Category: feature » bug

I think sndev's approach is very promising, but since it doesn't seem like it will be pursued further, we should just remove

'#required' => ($anon_meta_info == COMMENT_ANONYMOUS_MUST_CONTACT)

from line 414 ($form[homepage]) of nodecomment.module. This is very straightforward, I guess.

BTW, thumbs up crea for comitting / writing so many patches in such a short time. all hail to the new maintainer!

crea’s picture

Status: Needs review » Closed (duplicate)

Setting this duplicate of #793614: Comment form validation.. I'll include the fix for this bug in that patch.