-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[5.2] Fix reCAPTCHA Invisble error getElementsByClassName().forEach is not a function #44306
Conversation
I have tested this item ✅ successfully on dfc56ea This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44306. |
I tried this fix on 2 sites where reCaptcha invisible broke with this error after upgrading to Joomla 5.2.0, and, while the error went away, the captchas still do not appear. I have both configured to display as inline reCaptchas and none of them are showing. |
Thanks for the fix but, it seems bug's solution seems to be requiring more than using a different method. People are using different modules/plugins for forms and captchas. For example I use RSContact and reCAPTCHA v3, and my generated site code doesn't even have a class name of g-recaptcha, as queried by current and proposed code. |
I cannot get recaptcha (v2 & v3) work with Joomla 5.2. hcaptcha requests challenge from user every time, (mostly) passive mode is for $99 monthly... So, for my basic needs, I decided to use Aimy Captcha-Less Form Guard (on RSContact and Joomla 5.2). It seems odd to me that Joomla does not natively support a captcha mechanism 🤔 |
Tested on my 5.2 site, it does not work. The captcha logo does not appear. When i am using the js-files from Joomla 5.1.4 the captcha works as expected. |
Same issue with Joomla 5.2.1 Fix does not work, had to replace the 3 files with the Joomla 5.1.4 ones |
It seems Joomla's captcha interface (aforementioned js-files and "Default Captcha" global setting) is now broken. Observations at 5.2 and 5.2.1:
|
@tschombes @fire2 @YasarYY How have you applied the fix from this PR here? As this PR is not merged yet, it was of course not included in 5.2.0 or 5.2.1. If you want to help that it becomes included in the upcoming 5.2.2, you can test that PR, because every PR needs 2 successful human test before it can be merged. One way to apply the PR would be to download the update zip for that PR here
Then backup the existing 3 files on your site which you had copied from 5.1.4 and then replace the existing files by the one unpacked from the zip. Finally clear your browser cache to make sure your browser doesn't use the old, cached files and test if it works. Please report back the result in PR #44306 . Thanks in advance. |
I have moved all my sites' captchas to either v3 or an other captcha solution. So I'm not able to test this. But, there is an open issue at Sharky's recaptcha-v3, mentioning it does not work with Joomla 5.2. So I tested this PR on it, as you described, and it didn't work. But since that is a v3 plugin, it may be irrelevant to this issue. This fix seems to make the necessary code change, completing the code update at Minor cleanup for plugins JS PR, including using querySelectorAll instead of getElementsByClassName. But maybe something else is also broken, causing captcha issues at Joomla sites. So, for me, I cannot test this PR for v2, and it didn't fix v3. |
I have tested this item ✅ successfully on 9c78b5c Then I've updated to 5.2.0 with Live Update ("Next" channel) and have reproduced the issue. Then I've updated to this PR using Live Update with the custom update URL created by Drone and have verified that the issue is fixed, i.e. the captcha "button" is shown and the JS error mentioned in the issue does not appear. Sending a mail with the contact form protected by the captcha has worked. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44306. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44306. |
Thank you for this fix! |
Pull Request for Issue #44294.
Summary of Changes
Fix getElementsByClassName().forEach is not a function for reCAPTCHA Invisble.
Caused by #42797
Testing Instructions
Install Joomla 4, activate reCAPTCHA Invisble somewhere.
Update to Joomla 5.
Or, code review,
HTMLCollection
result ofgetElementsByClassName()
does not haveforEach()
menthod.Actual result BEFORE applying this Pull Request
reCAPTCHA Invisble broken
Expected result AFTER applying this Pull Request
reCAPTCHA Invisble works
Link to documentations
Please select: