User tests: Successful: Unsuccessful:
Pull Request for Issue #28758
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.
please look for detail #28758
Captcha wokrs
Captcha not wokrs
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript Repository NPM Change Libraries Front End Plugins |
Labels |
Added:
NPM Resource Changed
?
|
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
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:
?
|
Thanks all.
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
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
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);
I have tested this item✅ successfully on 77a4c8b
The reCaptcha works ok again. Thanks for the fix!
Before the patch - reCaptcha is missing
After the patch - reCaptcha is visible and working again
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28785.