UndefinedOffset / silverstripe-nocaptcha

A spam protector and form field using Google's reCAPTCHA v2 or optionally a foundation v3 implementation
BSD 3-Clause "New" or "Revised" License
31 stars 37 forks source link

ReCAPTCHA couldn't find user-provided function #50

Closed b-rhodes closed 5 years ago

b-rhodes commented 5 years ago
ReCAPTCHA couldn't find user-provided function: Nocaptcha-QuoteForm_QuoteForm_Captcha
recaptcha__en.js:formatted:13193

I'm getting this javascript error when submitting a form, any idea what could be causing it?

UndefinedOffset commented 5 years ago

What version of the module are you using and what version of the cms are you using? Are there any other JavaScript errors prior to attempting to submit the form?

b-rhodes commented 5 years ago

Sorry for late reply, I'm using Silverstripe 4.1.2 There is another javascript error, but it's unrelated.

UndefinedOffset commented 5 years ago

Ok three more questions (sorry just trying to narrow down the issue):

  1. What version of this module are you using
  2. What version of jQuery are you using?
  3. Are you using jQuery validator, if so which version of it?
dunatron commented 5 years ago

I am also getting this issue. ReCAPTCHA couldn't find user-provided function: Nocaptcha-Form_AskAQuestion_Captcha

undefinedoffset/silverstripe-nocaptcha (2.0.3) jQuery v: 1.10.2

extravio commented 5 years ago

I think the problem is that the "window.Nocaptcha-Form_[Whatever]_Captcha" function is only defined for invisible Recaptcha (NocaptchaField.js line 38). However, the callback function is still set to this global function independently of the "data-size" attribute (NocaptchaField.js line 57).

UndefinedOffset commented 5 years ago

I think @extravio is correct, I'll see if I can get a fix done up later today

UndefinedOffset commented 5 years ago

Fixed and tagged as 2.0.4