Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comments
Comment #2
sergey-serovGreetings, 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 :)
Comment #3
sachbearbeiter CreditAttribution: sachbearbeiter commentedThanks a lot for the feedback ...
If we find some solution i let you know ;)
Comment #4
JonasSavs CreditAttribution: JonasSavs as a volunteer and commentedHi Guys,
I did get this issue too.
Resolved and uploading a patch.
Hope it helps.
Regards,
Nelson
Comment #5
sergey-serovHi Nelson!
Great!!
Sure, this way more appropriate for adding js and it may resolve some other troubles too.
Comment #6
sachbearbeiter CreditAttribution: sachbearbeiter commented@Nelson: Thanks a lot ...
I will test ...
Comment #7
sachbearbeiter CreditAttribution: sachbearbeiter commentedSeems to work - super ;)
Comment #8
sachbearbeiter CreditAttribution: sachbearbeiter commented@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 ...
Comment #9
nikolabintev CreditAttribution: nikolabintev commentedHello 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.
Comment #10
nikolabintev CreditAttribution: nikolabintev commentedComment #11
simeon157 CreditAttribution: simeon157 at FFW commentedThere is an issue with the recaptcha where sometimes the grecaptcha.render function is undefined. I've added a check for that.
Comment #12
frakke CreditAttribution: frakke at Adapt commentedThe 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.
Comment #13
frakke CreditAttribution: frakke at Adapt commentedThe recaptcha isn’t always rendered, so we wrap the reset in a try/catch and render it again if it throws an error.