Question

I've just upgraded our site to Magento 2.1.18 and Captcha no longer works on the customer registration page.

Is anyone else aware of this issue?

There are no errors in the logs or browser console, it just doesn't appear anymore.

I have noticed since upgrading that the admin panel options have changed, I've tried saving them again, but without success.

Admin Options BEFORE Upgrade
enter image description here

Admin Options AFTER Upgrade
enter image description here

I have also noticed that now captcha assets are being loadedd twice in the head of the document.

<script type="text/javascript" async="" src="https://www.gstatic.com/recaptcha/api2/v1560753160450/recaptcha__en_gb.js"></script>
<script type="text/javascript" async="" src="https://www.gstatic.com/recaptcha/api2/v1560753160450/recaptcha__en_gb.js"></script>
<script async="" src="https://www.google.com/recaptcha/api.js?onload=globalOnRecaptchaOnLoadCallback&amp;render=explicit"></script>
<script async="" src="https://www.google.com/recaptcha/api.js?onload=globalOnRecaptchaOnLoadCallback&amp;render=explicit"></script><script>

Whereas before it was only loading once

<script type="text/javascript" async="" src="https://www.gstatic.com/recaptcha/api2/v1560753160450/recaptcha__en_gb.js"></script>
<script async="" src="//www.google-analytics.com/analytics.js"></script><script>

Pas de solution correcte

Autres conseils

Fo me I discovered the issue was that the theme was redeclaring the form.additional.info container in Magento_Customer/layout/customer_account_create.xml

<container name="form.additional.info" as="form_additional_info"/>

So I replaced the above with the same code I found in vendor/msp/recaptcha/view/frontend/layout/customer_account_create.xml

<container name="form.additional.info" as="form_additional_info">
    <block class="MSP\ReCaptcha\Block\Frontend\ReCaptcha" name="msp-recaptcha" after="-"
           template="MSP_ReCaptcha::msp_recaptcha.phtml"
           ifconfig="msp_securitysuite_recaptcha/frontend/enabled">

        <arguments>
            <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                    <item name="msp-recaptcha" xsi:type="array">
                        <item name="component" xsi:type="string">MSP_ReCaptcha/js/reCaptcha</item>
                        <item name="zone" xsi:type="string">create</item>
                    </item>
                </item>
            </argument>
        </arguments>
    </block>
</container>

Stupid Theme!

Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top