Problem/Motivation

At this moment, the error message the user gets when it enters an incorrect CAPTCHA answer ("The answer you entered for the CAPTCHA was not correct.") is hard-coded in the module. Sometimes this message does not really suit the situation.

For example: When using reCaptcha, the user cannot really answer a CAPTCHA. It can only check a "I am not a robot" checkbox. So the hard-coded message is not the best message you can give when a user forgets/fails to pass the reCaptcha check. A message like "Please verify that you are not a robot bij checking the "I am not a robot" checkbox." is a better message.

Proposed resolution

Add an extra textfield in the Captcha configuration field where you can enter a custom error message. A a consequence, the error should be translatable.

Remaining tasks

  • Add extra error message field in the configuration field.
  • Show this error message when a users fails the CAPTCHA test.
  • Add/modify tests for this.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BryanDeNijs created an issue. See original summary.

BryanDeNijs’s picture

Issue summary: View changes
FileSize
3.56 KB

I created a patch to implement the new configuration field.

The only thing that needs to be done is adding/modifying the tests, but I'm having troubles with this and I hope that someone can do this for me.

elachlan’s picture

Status: Active » Needs review
elachlan’s picture

Version: 8.x-1.0-beta1 » 8.x-1.x-dev
Status: Needs review » Needs work

Needs re-roll.

vakulrai’s picture

Status: Needs work » Needs review
FileSize
4.2 KB

Adding a patch for tests.

Status: Needs review » Needs work

The last submitted patch, 5: configurable_captcha-2959577-5.patch, failed testing. View results

couturier’s picture

This is a great idea. Is anyone able to help with the push to get this and other changes incorporated to a stable 8.x version? See discussion at attached link.

helmo’s picture

Status: Needs work » Needs review
FileSize
3.27 KB

Here's just a re-roll of #2. The test code added in #5 nolonger applies as all tests were converted since then.

keshavv’s picture

FileSize
72.99 KB

Test patch #8. working as excepted.
I think its ready to merge with the module.

Thank you.

keshavv’s picture

Status: Needs review » Reviewed & tested by the community
japerry’s picture

Status: Reviewed & tested by the community » Needs work

The tests definitely need revamping. Even after trying to reroll the patch, there are some bigger issues with how the error message is hardcoded in them.

Marking needs work so hopefully someone with some more time can take a look and get tests passing first.

paulocs’s picture

Assigned: Unassigned » paulocs

I'll provide a patch.

paulocs’s picture

Assigned: paulocs » Unassigned
Status: Needs work » Needs review
FileSize
5.58 KB

Added the feature and test coverage.

guilhermevp’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
17.01 KB
62.25 KB

Patch work as intended. There is a configurable message and the message shows up when captcha answer is wrong.

1

2

japerry’s picture

Status: Reviewed & tested by the community » Fixed

Yah that looks better. Fixed!

  • japerry committed ae73e6e on 8.x-1.x authored by BryanDeNijs
    Issue #2959577 by BryanDeNijs, paulocs, vakulrai: Make the incorrect...
BryanDeNijs’s picture

Thank you all for all the extra work and for committing it!

paulocs’s picture

:)

Status: Fixed » Closed (fixed)

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