NPM Resource Changed ? ? Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
25 Apr 2020

Pull Request for Issue #28758

Summary of Changes

Fixing Joomla\CMS\Captcha\Captcha because onInit(), onDisplay(), onCheckAnswer() is a callbacks and not an events

Also fixing JS that use incorrect methods as a capctha callback.

Testing Instructions

please look for detail #28758

Expected result

Captcha wokrs

Actual result

Captcha not wokrs

avatar Fedik Fedik - open - 25 Apr 2020
avatar Fedik Fedik - change - 25 Apr 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 25 Apr 2020
Category JavaScript Repository NPM Change Libraries Front End Plugins
77a4c8b 25 Apr 2020 avatar Fedik dog
avatar Fedik Fedik - change - 25 Apr 2020
Labels Added: NPM Resource Changed ?
avatar Fedik Fedik - change - 25 Apr 2020
The description was changed
avatar Fedik Fedik - edited - 25 Apr 2020
avatar pe7er
pe7er - comment - 25 Apr 2020

I have tested this item successfully on 77a4c8b

The reCaptcha works ok again. Thanks for the fix!

Before the patch - reCaptcha is missing

screencapture-local-joomla-cms-nl-index-php-contact-form-2020-04-25-13_54_15

After the patch - reCaptcha is visible and working again

screencapture-local-joomla-cms-nl-index-php-contact-form-2020-04-25-13_54_50


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28785.
avatar pe7er pe7er - test_item - 25 Apr 2020 - Tested successfully
avatar alikon
alikon - comment - 25 Apr 2020

I have tested this item successfully on 77a4c8b


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

avatar alikon alikon - test_item - 25 Apr 2020 - Tested successfully
avatar alikon alikon - change - 25 Apr 2020
Status Pending Ready to Commit
avatar alikon
alikon - comment - 25 Apr 2020

RTC


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

avatar richard67 richard67 - change - 25 Apr 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-04-25 14:57:37
Closed_By richard67
Labels Added: ?
avatar richard67 richard67 - close - 25 Apr 2020
avatar richard67 richard67 - merge - 25 Apr 2020
avatar richard67
richard67 - comment - 25 Apr 2020

Thanks all.

avatar wilsonge
wilsonge - comment - 25 Apr 2020

This isn’t right. The change in j4 was deliberately to use plugins events. It’s fine to merge this as it is to get things working. But can we please investigate what’s needed to make this use events properly

avatar richard67
richard67 - comment - 25 Apr 2020

As requested by @wilsonge I've created issue #28800 so that it's not forgotten.

avatar Fedik
Fedik - comment - 25 Apr 2020

@wilsonge the thing that an event should be called strictly to "this specific plugin", not system wide.
This for Cpatcha group and for Editor plugin group.

Check how j3 work

avatar mbabker
mbabker - comment - 26 Apr 2020

That's not how an event system works. And that's why the hackjobs inside the captcha and editor API were rightfully changed from some convoluted callback system to using events. It is up to a listener (the captcha plugins in this case) to decide whether or not the emitted event applies to it.

Just because things are done a certain way in 3.x does not mean they were done right. Otherwise, just throw all of 4.0 out the window since clearly nothing needed to change ?

avatar Fedik
Fedik - comment - 26 Apr 2020

Just because things are done a certain way in 3.x does not mean they were done right

Well, I did not meant it is right (or wrong), I am about how it work, the behavior, that the plugin updated "locally"

Okay I think this a solution, is to throw away global dispatcher (from captcha and editor):

$this->setDispatcher(Factory::getApplication()->getDispatcher());

And use local one, per Joomla\CMS\Captcha\Captcha, Joomla\CMS\Editor\Editor instance:

$this->setDispatcher(new EventDispatcher);
avatar Fedik
Fedik - comment - 26 Apr 2020

there is another try #28808 please check

Add a Comment

Login with GitHub to post a comment