Skip to Content

Orbeon Form - reCAPTCHA Field required error after submitting form

I'm struggling to make reCAPTCHA work in my Orbeon form. I'm using ORBEON 2017.2.2 PE with Hybris 6.6. After submitting the form, I get the error "Please check your answer to the CAPTCHA challenge" even though the captcha is correct.

Created a common Form and added reCAPTCHA as per official Orbeon documentation: https://doc.orbeon.com/form-runner/component/captcha

Added my private and public keys to the properties file Added the reCAPTCHA property to my form:

 <property
         as="xs:string"
         name="oxf.fr.detail.captcha.yforms.myForm"
         value="reCAPTCHA"/>

This is the process executed when clicking the SUBMIT button:

    validate-all
      then save
     then send(
      uri        = "https://myurl",
      method     = "PUT"
      )
      then navigate(uri = "https://myurl")
  </property>

I see the reCAPTCHA at the bottom of my form as expected When I click SUBMIT after filling up the form and completing the captcha successfully, I see a popup saying "There are validation errors. Please retry once all fields have been properly filled-out." And the form displays this error for the captcha field: "Please check your answer to the CAPTCHA challenge." So I'm clearly missing something. I know there are some configurations needed for the fr-verify-done and fr-verify-error to be added, but the Orbeon documentation does not specify how to configure those through PROPERTIES. They only say how to add those event listeners while adding the captcha component by hand (editing the source code of the form through Form Builder).

Things that I tried and didn't work:

Dispatching an fr-verify event when submitting:

 xf:dispatch(name = "fr-verify", targetid = "captcha")
 then validate-all 
 then save 
 then send( uri = "https://myurl", method = "PUT" ) 
 then navigate(uri = "https://myurl")

Adding the reCAPTCHA component to the form source code as per Orbeon documentation:

 <fr:recaptcha id="my-captcha">
 <xf:send ev:event="fr-verify-done" submission="save-submission"/>
 <xf:action ev:event="fr-verify-error">
 <xf:toggle case="failure-case"/>
 <xf:dispatch target="my-captcha" name="fr-reload"/>
 </xf:action>
 </fr:recaptcha>

When I click SAVE after adding the excerpt above, the Form Builder crashes. Same happens if I try to add the same excerpt to a form through the online demo form builder provided by Orbeon : https://demo.orbeon.com/demo/fr/orbeon/builder/new That is super weird since I'm adding code provided by them using the online last version of the form builder, and it still crashes when trying to save it. So that makes me think the problem I have is not related to my platform, but with Orbeon itself.

This is the error I get in the online demo for Form Builder after adding the recaptcha excerpt to the source code of the form: "Cannot read property 'call' of undefined'

There're no relevant LOGS that I can provide, I activated debug level logs for Orbeon and I'm not getting any useful info.

Most probably this is a problem within hybris. Is there any call to the Persistence API when the fr-verify event is triggered or when the form fields are being validated? Cause I've been trying to debug every backend hybris api related to Orbeon and nothing is called when the captcha is validated nor during form fields validation.

I would really appreciate if someone can guide me through with either: - Configuring the fr-verify events without changing the source code of the form using Form Builder, OR - Adding the reCAPTCHA component through Form Builder successfully without making it crash, OR - Anything you can come up with to make my form with captcha work

Stackoverflow question: https://stackoverflow.com/questions/57104729/orbeon-form-recaptcha-field-required-error-after-submitting-form

Thanks in advance, David

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jul 22, 2020 at 10:16 AM

    Hi David,

    Do you get solution for your above problem statement?

    Regards,

    Vikram

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.