pe7er / hCaptcha

A simple CAPTCHA Plugin using the hCaptcha service to protect your Joomla site against SPAM
13 stars 7 forks source link

Cannot create article in frontend when hCaptcha is enabled #38

Closed badewanne1234 closed 2 years ago

badewanne1234 commented 2 years ago

Hi

I'm on J4 and using hCaptcha 1.4.1. I can create articles in the backend and hCaptcha works in the frontend when submitting forms and so on.

I have also the option to create an article via the frontend, which contains the hCaptcha section too - as soon as want to do that, I get the following error message over the whole screen: 0 Too few arguments to function PlgButtonImage::onDisplay(), 2 passed in /www/libraries/src/Plugin/CMSPlugin.php on line 285 and exactly 3 expected

When I turn off the hCaptcha plugin, it works and I can create the article. I already tried to reinstall (without uninstall) the hCaptcha plugin, without luck.

pe7er commented 2 years ago

Hi,

Thank you for reporting an issue with hCaptcha. I'll try to reproduce your issue and solve it. I'll keep you informed!

pe7er commented 2 years ago

@badewanne1234 I cannot reproduce the issue that you reported.

I've tried to reproduce your issue on a default Joomla 4.1.0 website using:

I edited an article on the front-end, the hCaptcha is displayed and can be solved. I am able to submit the article without any errors.

The hCaptcha Captcha plugin itself does not use a class/method PlgButtonImage::onDisplay(). That class/method is used in /plugins/editors-xtd/image/image.php Which is the "editors-xtd" plugin "Button - Media". That plugin displays a button to insert media into an editor area.

badewanne1234 commented 2 years ago

I'm using a 3rd party template and not the Cassiopeia template. It turns out it works with the Cassiopeia template but not with the template I am using.

So I tried the following:

The odd thing is: when "Button - Media" is enabled but "hCaptcha" is disabled, it works with the 3rd party template too, so somewhere, something goes wrong but I don't know what the root cause is... Do you have an idea why? I can provide logs if needed.

Btw, I just updated to hCaptcah 1.4.2 but the issue persists.

Thank you.

pe7er commented 2 years ago

Thank you for your tests and description of the issues you encounter.

hCaptcha is a drop-in replacement for the CAPTCHA plugins that are shipped with Joomla. Does the front-end article editing work with your template and a core CAPTCHA plugin like Google reCaptcha?

The hCaptcha 1.4.2 update only fixed a small issue with language files.

badewanne1234 commented 2 years ago

Oh oh oh... I tried it with Google reCaptcha - same issue :-( So this is a template issue, not a hCaptcha issue. Thanks for your help @pe7er!

pe7er commented 2 years ago

@badewanne1234 You're welcome! Thanks for reporting back!