5 years 1 month ago #1 by REBECCA
Inquiry was created by REBECCA
Hello Christopher. Just being inquisitive and I was wondering if you could elaborate any further on the Captcha fix in version 2.3.378. By elaborate I mean specifically what was the previous bug or issue? Thanks

-Rebecca M.

Please Log in or Create an account to join the conversation.

5 years 1 month ago #2 by Christopher Mavros
Replied by Christopher Mavros on topic Inquiry
Hello Rebecca and thank you for asking that!

Joomla has its own way to work with Captchas. After all these years, it has changed a few times and I still haven't been able to feel completely satisfied with the way it works. We still have very little information on how to check a Joomla captcha plugin with Javascript, and suddenly some months ago, Joomla also started to throw a RuntimeException in PHP every time the captcha wasn't completed, leading to a white page with an error, as if there are no times that a user may forget to click on the captcha and still want the site to show up normally. Anyway...

Up to now, we were checking captchas primarily with Javascript. Although, since there isn't any Joomla API to do that, we had to assume that the captcha used was ReCaptcha and thus check for ReCaptcha.
However, using this method, created two more issues. If there are two forms with a captcha in one page (which may very well be two different extensions) the Javascript check didn't work. The user had to click on every single captcha on the page to proceed with the form they wanted to submit.
If the captcha used wasn't ReCaptcha, or if we omitted the Javascript check, the user would see an ugly white page with the Joomla captcha error.
So there were 3 issues:
1. Only Javascript check was for ReCaptcha
2. Form wouldn't submit unless you click all ReCaptchas in the page
3. Ugly white page.

So, we implemented the following method:
If there is one captcha in the page, and that captcha is ReCaptcha, check with Javascript. If not, just bypass this test and allow PHP to do the work.
In PHP, we handled the RuntimeException and show the normal anti-spam error within the form.

Thanks again.

Christopher Mavros
If you like our extensions, please rate us on the JED!

Please Log in or Create an account to join the conversation.

5 years 1 month ago #3 by REBECCA
Replied by REBECCA on topic Inquiry
Thanks for the rundown. For what it's worth, I've not had any issues you've explained. Latest Joomla with PHP 7.2 and I use the core ReCaptcha which is also used with my Rapid Ex forms. Appreciate it.


Please Log in or Create an account to join the conversation.

Moderators: Christopher Mavros