Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Google Recaptcha v3 not work in modular page

Started by Pedro M 4 years ago · 5 replies · 1091 views
4 years ago

Hi

I have the contact form in a modular page, and when I configure the .md file with the Grav website instructions, it show "Captcha not valid".
I have configured the site and secret keys in the form plugin.

My code is this:

YAML
name: g-recaptcha-response
label: Captcha
type: captcha
recaptcha_not_validated: 'Captcha not valid!'

process:
    captcha: true

What's wrong?

4 years ago

I also couldn't make v3 work in modules. Still using v2

4 years ago

Hi.

I've changed to V2 invisible, and the form.yaml is this:

YAML
recaptcha:
  version: 2-invisible
  theme: light
  site_key: XXXXXXXXXXXX
  secret_key: XXXXXXXXXXXX

In contact.md ...

YAML
-
      name: g-recaptcha-response
      label: Captcha
      type: captcha
      recaptcha_not_validated: 'Captcha not valid!'
process:
        captcha: true

However, is still failing with message "Captcha not valid".

My contact.html.twig modular page has this code:

TWIG
{% block content %}

<!-- Contact -->
<section id="contact" class="wrapper style2">
    <div class="inner narrow">
        <header class="heading major">
            <h2>{{page.title|raw}}</h2>
            <p>{{page.header.subtitle|raw}}</p>
        </header>
        <form action="#" method="post">
            {% include 'forms/form.html.twig' with { form: forms('contact-form') } %}
        </form>
    </div>
</section>

{% endblock %}

Is there any wrong?

4 years ago

Sorry, didn't mention - I couldn't make v2 invisible work either 😅 Users still have to check they're not robots on my page 😃

4 years ago

Finally I have chosen to use version 2 of Google's captcha, with checkbox, and it is working correctly.
It seems that versions 3 and 2 - invisible, don't work well with the form plugin.

Thanks for your help

4 years ago

Actually, there are more problems with reCapatcha.
I've created a bug report but haven't received any answer from developers.
You could upvote it, maybe they will take a look at it.

👍 1

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 85 13 hours ago
General · by pamtbaau, 18 hours ago
1 60 17 hours ago
General · by Andy Miller, 1 day ago
0 47 1 day ago
General · by Marcel, 12 months ago
6 350 5 days ago
General · by Duc , 6 days ago
3 44 5 days ago