A forum site I maintain wants the reply form on the same page as the forum thread. This ruins caching, of course.

So I made the option to show (only) reply forms with CAPTCHAs on a separate page. (There's a choice to do this only for anonymous users, or for all users who get shown CAPTCHAs. Which in practice is hardly a difference.)

Note: the patch as-is creates a slight behavior change (because the default is to move the comment form to a different page). If you don't like that, you can change the default from 1 to 0.

CommentFileSizeAuthor
captcha-movecomment.patch3.41 KBroderik

Comments

soxofaan’s picture

interesting idea

Maybe it makes more sense to make a standalone module of this patch?
I'd happily add a link to it on the CAPTCHA project page

roderik’s picture

I don't know - what's the reason for a separate module?

- it isn't much extra code
- the code doesn't take much maintenance or bug reports/suggestions or other things that still should be developed further, IMHO.
- it does't complicate the rest of the module or UI much. (It adds one extra choice, in the node type settings screen which people aren't exactly looking at much.

Is the reason you don't want it in the main module, that this functionality will only be used very little?

In that case, do you accept a separate module to put into the CAPTCHA project? I'm personally not a fan of cluttering the d.o project space with stuff that does only one little thing and has one dependency.
(I'm always reachable for fixes if need be. user/8841 and still here.)

soxofaan’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Status: Needs review » Needs work

Ok, I probably misunderstood your original post. I thought it was about the specific case of reply forms for forums, not general comment forms. I assumed you meant with "reply": reply on a comment, but apparently "reply" and "comment" are used as synonyms on the node type form.

Anyway, I might indeed be useful to include this feature in the CAPTCHA module.

Some remarks though:

  • it didn't work when I tried it: on my setup the captcha module comes before the comment module so the alter from captcha_form_node_type_form_alter was overwritten by comment_form_node_type_form_alter. It only worked when I increased the CAPTCHA module weight in the system table.
  • I think it's confusing that there are now two related options "Show reply form on the same page as comments " and "Show reply form on the same page as comments ". IMHO it would be better if both would be combined in one option.
  • you make a distinction between anonymous and non-anonymous, but the CAPTCHA module only looks at the "skip CAPTCHA" permission. This might increase the confusion of how the feature works and should behave.
  • for the comment_form_location_captcha_xxx variable, you use hardcoded 0, 1 and 2 values. It would be better for readability and maintainability to define constants for these
  • You don't seem to handle the case "1 => t('Show on separate page for anonymous users'), or am I missing something?
wundo’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)