The ReCaptcha module in a webform is not working correctly when Clientside Validation is enabled. The webform will not submit and an error "Wrong answer for captcha" is displayed even though "I'm not a robot" is checked.

CAPTCHA 7.x-1.4
reCAPTCHA 7.x-2.2
Clientside Validation 7.x-1.44
Webform 7.x-4.15

When checking the recent log messages, 4 php errors appear.

php 2017-05-24 09:05 Warning: Missing argument 4 for recaptcha_captcha... Anonymous (not verified)
php 2017-05-24 09:05 Warning: Missing argument 3 for recaptcha_captcha... Anonymous (not verified)
php 2017-05-24 09:05 Warning: Missing argument 4 for recaptcha_captcha... Anonymous (not verified)
php 2017-05-24 09:05 Warning: Missing argument 3 for recaptcha_captcha... Anonymous (not verified)

Clicking on the LOCATION link I get:

{"result":false,"message":"CAPTCHA validation error: unknown CAPTCHA session ID. Contact the site administrator if this problem persists."}

The message is Warning:

Missing argument 4 for recaptcha_captcha_validation(), called in /.../sites/all/modules/clientside_validation/clientside_validation.module on line 239 and defined in recaptcha_captcha_validation() (line 144 of /.../sites/all/modules/recaptcha/recaptcha.module).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plinto created an issue. See original summary.

Clemens Sahs’s picture

Status: Active » Needs review
FileSize
1.33 KB

This patch help my.

plinto’s picture

With the patch, clientside validation works correctly; the form submits when checked and displays an error message when not checked.

However, when the captcha is not checked and submit is pressed, the php error messages appear in the recent log messages.

hugronaphor’s picture

In my case I found this patch needed for the following case:
- User submits the form without clicking the captcha checkbox to pass the verification;
- The error is shown;
- Clicking/Passing verification;
- Submitting the form still says "Wrong answer for captcha".