RTC Release Blocker NPM Resource Changed bug PR-5.2-dev Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
18 Oct 2024

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 of getElementsByClassName() does not have forEach() 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:

  • Documentation link for docs.joomla.org:
  • No documentation changes for docs.joomla.org needed
  • Pull Request link for manual.joomla.org:
  • No documentation changes for manual.joomla.org needed
avatar Fedik Fedik - open - 18 Oct 2024
avatar Fedik Fedik - change - 18 Oct 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 18 Oct 2024
Category JavaScript Repository NPM Change
avatar Fedik Fedik - change - 18 Oct 2024
The description was changed
avatar Fedik Fedik - edited - 18 Oct 2024
avatar Fedik Fedik - change - 18 Oct 2024
The description was changed
avatar Fedik Fedik - edited - 18 Oct 2024
avatar Quy Quy - test_item - 18 Oct 2024 - Tested successfully
avatar Quy
Quy - comment - 18 Oct 2024

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.

avatar fire2
fire2 - comment - 21 Oct 2024

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.

avatar YasarYY
YasarYY - comment - 25 Oct 2024

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.
Something deeper is going on but I cannot find it. May be some J! code which was being used by 3rd party codes altered or deleted somewhere at v5.2 dev. I'll dig as I have time.

avatar YasarYY
YasarYY - comment - 26 Oct 2024

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 🤔

avatar tschombes
tschombes - comment - 31 Oct 2024

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.

avatar tschombes
tschombes - comment - 8 Nov 2024

Same issue with Joomla 5.2.1

Fix does not work, had to replace the 3 files with the Joomla 5.1.4 ones

avatar YasarYY
YasarYY - comment - 8 Nov 2024

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:

  • DJ-EasyContact form plugin: not using Joomla's captcha interface, implicitly implemented, working fine.
  • reCAPTCHA v3 plugin (on RSContact form plugin): using Joomla's captcha interface, does not work.
avatar richard67 richard67 - change - 9 Nov 2024
Labels Added: Release Blocker NPM Resource Changed bug PR-5.2-dev
avatar richard67 richard67 - alter_testresult - 9 Nov 2024 - Quy: Tested successfully
avatar richard67
richard67 - comment - 9 Nov 2024

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

@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
https://artifacts.joomla.org/drone/joomla/joomla-cms/5.2-dev/44306/downloads/80218/
and unpack the following files from that zip:

  • media/plg_captcha_recaptcha_invisible/js/recaptcha.js
  • media/plg_captcha_recaptcha_invisible/js/recaptcha.min.js
  • media/plg_captcha_recaptcha_invisible/js/recaptcha.min.js.gz

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.

avatar YasarYY
YasarYY - comment - 9 Nov 2024

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.

avatar richard67 richard67 - test_item - 10 Nov 2024 - Tested successfully
avatar richard67
richard67 - comment - 10 Nov 2024

I have tested this item ✅ successfully on 9c78b5c

I've made a new installation of 4.4.9 and have successfully set up Google Recaptcha v2 invisible and have tested that it works in a contact form.

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.

avatar richard67 richard67 - change - 10 Nov 2024
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 10 Nov 2024

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/44306.

avatar Quy Quy - change - 10 Nov 2024
Labels Added: RTC
avatar Hackwar Hackwar - change - 10 Nov 2024
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2024-11-10 19:34:48
Closed_By Hackwar
avatar Hackwar Hackwar - close - 10 Nov 2024
avatar Hackwar Hackwar - merge - 10 Nov 2024
avatar Hackwar
Hackwar - comment - 10 Nov 2024

Thank you for this fix!

Add a Comment

Login with GitHub to post a comment