VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: ec83 on November 13, 2023, 14:39:48 PM

Title: Plugin ReCaptcha endlessly
Post by: ec83 on November 13, 2023, 14:39:48 PM
Hello, I have noticed for 2/3 days that the Recaptcha plugin on the store has been running in a loop.
When you click on the check box the circle spins and nothing happens. It is therefore impossible to register.

https://ibb.co/q0jJzfz (https://ibb.co/q0jJzfz)

Do you have an idea ?

There have been no recent technical changes to the store.
What do you think ? Have you encountered this problem recently.

Nothing special in the browser development console.

Thanks

Environment :
Joomla 3.10.12
Virtuemart 3.8.9 10514
PHP 7.4.33
MySQL 5.7.42
Title: Re: Plugin ReCaptcha endlessly
Post by: ec83 on November 20, 2023, 16:18:24 PM
It seems that the problem comes from the Mootools Javascript library. There is an incompatibility with Google recaptcha. This mainly impacts Joomla v3.x.

While waiting for the migration to Joomla 4.x and Virtuemart 4.x, do you know of an alternative?
I tested the Amy Captcha extension https://aimy-extensions.com/ (https://aimy-extensions.com/) without success because it does not integrate with Virtuemart's registration form.

Thanks
Title: Re: Plugin ReCaptcha endlessly
Post by: Elboy on November 22, 2023, 05:50:47 AM
Could you disable mootools plugin?
I had the same problem in J3 (not with VM) and this plugin worked for me on contact forms
https://idealextensions.com/joomla-extensions/securimage-captcha-plugin.html
Title: Re: Plugin ReCaptcha endlessly
Post by: Emma Iana on November 29, 2023, 16:35:06 PM
Quote from: ec83 on November 20, 2023, 16:18:24 PM
It seems that the problem comes from the Mootools Javascript library. There is an incompatibility with Google recaptcha. This mainly impacts Joomla v3.x.

While waiting for the migration to Joomla 4.x and Virtuemart 4.x, do you know of an alternative?
I tested the Amy Captcha extension https://aimy-extensions.com/ (https://aimy-extensions.com/) without success because it does not integrate with Virtuemart's registration form.

Thanks

Hi,
disable mootools.

In my case it helped on captcha in Joomla but the one with VM after turning off mootools returns invalid-key. :(

Title: Re: Plugin ReCaptcha endlessly
Post by: ec83 on December 03, 2023, 23:19:44 PM
Hello,
A patch was found for version 1.4.5 of mootools on this forum: https://github.com/google/recaptcha/issues/539 (https://github.com/google/recaptcha/issues/539)

The solution must be able to adapt to version 1.4.2 to 1.6.0.
The modification consists of modifying the array.from function of mootools.

Array.from = function(item){
    if (item == null) return [];
    return (Type.isEnumerable(item) && typeof item != 'string') ? (typeOf(item) == 'array') ? item : slice.call(item) : [item];
};​


in this
Array.from = function(item){
    if(new Error().stack.indexOf('recaptcha') >= 0) return [].slice.call(item); // Single line added for reCaptcha fix
    if (item == null) return [];
    return (Type.isEnumerable(item) && typeof item != 'string') ? (typeOf(item) == 'array') ? item : slice.call(item) : [item];
};​


To avoid making the modification, the patched files (there are two versions of mootools, the normal one and the compressed one) can be found as an attachment. and they should be placed in the ROOT_of_site/media/system/js/

Remember to clear the cache to do the test.

Have a good day.
Title: Re: Plugin ReCaptcha endlessly
Post by: ec83 on February 14, 2024, 17:40:28 PM
I also found an extension that may help. Be careful to check that Mootools is not used on other parts of your site.

https://extensions.joomla.org/extension/core-enhancements/performance/mootools-enabler-disabler (https://extensions.joomla.org/extension/core-enhancements/performance/mootools-enabler-disabler)
Title: Re: Plugin ReCaptcha endlessly
Post by: hotrod on February 19, 2024, 14:07:05 PM
  I went with hcaptcha...  works great now..