Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recaptcha not showing #54

Closed
JohnMica opened this issue Mar 18, 2016 · 9 comments
Closed

recaptcha not showing #54

JohnMica opened this issue Mar 18, 2016 · 9 comments

Comments

@JohnMica
Copy link
Contributor

Hi guys, I have small issue with recaptcha as per the image attached, the api.js is loaded however the site key seems to be missing. I have just copied the form from learn.grav and for some reason all i get is the label captcha. any ideas why or how to solve this? the page is just a form.md page (not modular).
captura de ecran din 2016 03 18 la 17 00 15

@flaviocopes
Copy link
Contributor

Post your form.md file, without it it's hard to tell what could be wrong.

@JohnMica
Copy link
Contributor Author

---
title: Contact
body_classes: 'header-image fullwidth'
form:
    name: Formular-Contact
    fields:
        -
            name: name
            label: Name
            placeholder: 'Enter your name'
            autofocus: 'on'
            autocomplete: 'on'
            type: text
            validate:
                required: true
        -
            name: email
            label: Email
            placeholder: 'Enter your email address'
            type: text
            validate:
                rule: email
                required: true
        -
            name: message
            label: Message
            size: long
            placeholder: 'Enter your message'
            type: textarea
            validate:
                required: true

        -
            name: g-recaptcha-response
            label: Captcha
            type: captcha
            recaptcha_site_key: here is the site key -
            recaptcha_not_validated: 'Captcha not valid!'
            validate:
                required: true
    buttons:
        -
            type: submit
            value: Trimite
        -
            type: reset
            value: Anuleaza
    process:
        - captcha:
            recaptcha_secret: my secret key

        -
            email:
                from: '{{ config.plugins.email.from }}'
                to: ['{{ config.plugins.email.from }}', '{{ form.value.email }}']
                subject: '[Feedback] {{ form.value.name|e }}'
                body: '{% include ''forms/data.html.twig'' %}'
        -
            save:
                fileprefix: feedback-
                dateformat: Ymd-His-u
                extension: txt
                body: '{% include ''forms/data.txt.twig'' %}'
        -
            message: 'Multumim pentru mesaj'
        -
            display: multumim
---

### Contactati-ne

@JohnMica
Copy link
Contributor Author

where the site key and secret key have been edited but they are what google said

@flaviocopes
Copy link
Contributor

Check the page HTML source. There should be something like

    var captchaOnloadCallback = function captchaOnloadCallback() {
            grecaptcha.render('g-recaptcha', {
                'sitekey': "4453Lde3j23ej39je32je983j2e89j3298ej3982whatever",
                'callback': captchaValidatedCallback,
                'expired-callback': captchaExpiredCallback
            });
        };

@flaviocopes
Copy link
Contributor

Also disable page cache, to make sure it's not interfering

@JohnMica
Copy link
Contributor Author

cache has been disabled and deleted. all other changes appear upon refresh of the page.

this is one excerpt of the error from recaptcha_ro.js

kk = function(a, b) {
    var c = jk(a);
    if (0 < c.length)
        throw Error("Missing required parameters in RecaptchaOptions: " + c.join());
    var d = {};
    z(gb(ik),

@JohnMica
Copy link
Contributor Author

the html seems to not get the site key as per picture attached
captura de ecran din 2016 03 18 la 17 21 22

@flaviocopes
Copy link
Contributor

Ok I got it.

It's an issue that we had, there was a typo in recatpcha being used instead of recaptcha. Same was in our docs, which are now fixed.
It's fixed in the develop branch but not yet in the published release: d254542

The fix will then allow the typo too, not to break compatibility with forms with the typo, so just change to recatpcha_site_key and recatpcha_secret and you should be ok.

Let me know if this solves the problem.

@JohnMica
Copy link
Contributor Author

sorted - thanks for the quick help.
awesome platform by the way :) looking forward to the new releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants