In Joomla 4, the Google reCaptcha plugin seems broken.
The iframe with the Captcha is not loaded.
I've tested this issue also with the "System - HTTP Headers" plugin disabled, which gives the same result.
In Joomla 4 back-end:
On the front-end: Click on the "Contact form" menu item that you've just created.
At the bottom the form shows "Captcha * (optional)" but without the Google reCaptcha
The contact form should contain the reCaptcha CAPTCHA to protect the form against spam abuse.
I would expect Joomla's contact form to contain an iframe where the reCaptcha would be loaded.
The following HTML code is the HTML Source from a contact form (com_contact) that I copied from a Joomla 3.9.x website:
<fieldset>
<div class="control-group">
<div class="control-label">
<label id="jform_captcha-lbl" for="jform_captcha" class="hasPopover required" title="" data-content="Vul de beveiligingscontrole in." data-original-title="Captcha">
Captcha<span class="star"> *</span></label>
</div>
<div class="controls">
<div id="jform_captcha" class=" required g-recaptcha" data-sitekey="[xxx]" data-theme="light" data-size="normal" data-tabindex="0" data-callback="" data-expired-callback="" data-error-callback="" data-recaptcha-widget-id="0">
<div style="width: 304px; height: 78px;">
<div>
<iframe src="https://www.google.com/recaptcha/api2/anchor?[xxx]&theme=light&size=normal&cb=kc6a5cbbomxn" width="304" height="78" role="presentation" name="a-n2pvm9ei6huv" frameborder="0" scrolling="no" sandbox="allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation allow-modals allow-popups-to-escape-sandbox">
</iframe>
</div>
<textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid rgb(193, 193, 193); margin: 10px 25px; padding: 0px; resize: none; display: none;">
</textarea>
</div>
<iframe style="display: none;">
</iframe>
</div>
</div>
</div>
</fieldset>
In Joomla 4 the iframe is not loaded. The HTML source looks like:
<fieldset>
<div class="control-group">
<div class="control-label">
<label id="jform_captcha-lbl" for="jform_captcha" class="required">Captcha<span class="star" aria-hidden="true"> *</span></label>
<span class="optional">(optional)</span>
</div>
<div class="controls"></div>
</div>
</fieldset>
I ran into this issue when coding a hCaptcha CAPTCHA alternative: #28613
My hCaptcha plugin works on Joomla 3.9.x but not on Joomla 4.
Hence I was looking at the default Google reCaptcha in Joomla 4 and ran into the same issue.
Labels |
Added:
?
|
Title |
|
The bug in Joomla\CMS\Captcha\Captcha
onInit()
, onDisplay()
, onCheckAnswer()
is a callbacks and not an events
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-04-25 10:02:39 |
Closed_By | ⇒ | alikon |
maybe related to #28426 let's ping @Fedik for some more insight