Skip to content

Conversation

@Fedik
Copy link
Member

@Fedik Fedik commented Jan 17, 2023

Pull Request for Issue #28800 .

Summary of Changes

The patch improve Captcha plugins.
Now it can use a real events, and people stop confusing onDisplay (etc) callback with event.

How this work.
Here added a new event onCaptchaSetup and an Interface for CaptchaProvider class.
While this event the plugin should register own CaptchaProvider class in CaptchaRegistry.
The system will retrieve the requested Captcha type from that registry and call required methods, that defined by CaptchaProviderInterface

This is fully backward compatible.

Looking for feedback.
If all good we can do the same for Editor and its Buttons.

Techicaly now one plugin can provide multiple captcha, however for now the global configuration done per plugin.
But this can be extended in future, when need.

Testing Instructions

Apply patch, remove administrator/cache/autoload_psr4.php
Enable recaptcha_invisible and make sure it works.

Testing B/C:
Enable older recaptcha and make sure it works.

Actual result BEFORE applying this Pull Request

All works

Expected result AFTER applying this Pull Request

All works

Link to documentations

Please select:

@Fedik Fedik requested a review from laoneo as a code owner January 17, 2023 10:16
@joomla-cms-bot joomla-cms-bot added PR-4.3-dev RFC Request for Comment labels Jan 17, 2023
@dgrammatiko
Copy link
Contributor

@Fedik could you also move the captcha plugin to service providers, like #39639

@Fedik
Copy link
Member Author

Fedik commented Jan 17, 2023

Sure, will update later.

@laoneo
Copy link
Member

laoneo commented Jan 17, 2023

@Fedik could you also move the captcha plugin to service providers, like #39639

I would do this in a separate pr to not block each other.

@dgrammatiko
Copy link
Contributor

Sure, will update later.

Probably leave that for another PR. I'm waiting for the Editors, EditorsXtd version

 Conflicts:
	plugins/captcha/recaptcha_invisible/recaptcha_invisible.xml
	plugins/captcha/recaptcha_invisible/src/Extension/InvisibleReCaptcha.php
@Fedik Fedik changed the base branch from 4.3-dev to 4.4-dev March 26, 2023 09:34
 Conflicts:
	plugins/captcha/recaptcha_invisible/src/Extension/InvisibleReCaptcha.php
	tests/Unit/Plugin/Captcha/InvisibleRecaptcha/Extension/InvisibleRecaptchaPluginTest.php
@laoneo
Copy link
Member

laoneo commented Mar 30, 2023

I guess it is better to rebase this pr to the 5.0-dev branch, as it will get more attention for new features. Thanks for understanding.

@Fedik Fedik changed the base branch from 4.4-dev to 5.0-dev April 2, 2023 09:07
@Fedik Fedik mentioned this pull request Apr 2, 2023
@Fedik Fedik changed the title [RFC] Make captcha plugins use plugin events [5.0][RFC] Make captcha plugins use plugin events Apr 23, 2023
 Conflicts:
	tests/Unit/Plugin/Captcha/InvisibleRecaptcha/Extension/InvisibleRecaptchaPluginTest.php
@Fedik Fedik force-pushed the captcha-event2 branch from 235a462 to 9bff0ed Compare July 1, 2023 16:56
@Fedik Fedik changed the title [5.0][RFC] Make captcha plugins use plugin events [5.0][RFC][Events] Make captcha plugins use plugin events Aug 6, 2023
@HLeithner HLeithner merged commit d82aa35 into joomla:5.0-dev Aug 21, 2023
@HLeithner
Copy link
Member

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants