Hello,

maybe you have an idea how to solve the following problem:

- I have installed Google reCAPTCHA and Ajax Comments.
- I have activated Google reCAPTCHA for the comments form.
- Everything works fine - until f.e. i forget to fill a required field.
- The error massage is visible, but the Google reCAPTCHA form element is not shown again.

So maybe the reinitialisation together with the ajax reload is missing?

Should i ask this also in the Ajax Comments issue list?

Thanks and best regards
SB

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sachbearbeiter created an issue. See original summary.

sergey-serov’s picture

Assigned: Unassigned » sergey-serov

Greetings, sachbearbeiter!
I suppose the problem is in the rebuilding process.
This very like the situation with the form with image file upload field (which use ajax for generating image preview).
It is necessary to look in details on the process of form building when #rebuild == TRUE.
I will debug this case with Ajax Comment, but not promise that at the nearest time :)

sachbearbeiter’s picture

Thanks a lot for the feedback ...
If we find some solution i let you know ;)

JonasSavs’s picture

Hi Guys,

I did get this issue too.

Resolved and uploading a patch.

Hope it helps.

Regards,
Nelson

sergey-serov’s picture

Hi Nelson!
Great!!
Sure, this way more appropriate for adding js and it may resolve some other troubles too.

sachbearbeiter’s picture

@Nelson: Thanks a lot ...
I will test ...

sachbearbeiter’s picture

Seems to work - super ;)

sachbearbeiter’s picture

@Nelson
I have a list of node in an views teaser list - the captcha is only shown below the first node ...
Could be an Ajax Comments problem - we are investigating ...

nikolabintev’s picture

Hello guys,

#4 works for me, but the things is that the patch should be created from the project directory, but this one is created from 'sites' directory and cannot be applied correctly. That's why I've applied it and recreated it from google_recaptcha directory.

nikolabintev’s picture

Status: Active » Needs review
simeon157’s picture

There is an issue with the recaptcha where sometimes the grecaptcha.render function is undefined. I've added a check for that.

frakke’s picture

The recaptcha form can't be rendered once it's already rendered. This results in Js error, so we reset the form instead when it's already rendered after an ajax submit.

frakke’s picture

The recaptcha isn’t always rendered, so we wrap the reset in a try/catch and render it again if it throws an error.