-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[5.0][RFC][Events] Make captcha plugins use plugin events #39657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Member
Author
|
Sure, will update later. |
Member
Contributor
Probably leave that for another PR. I'm waiting for the Editors, EditorsXtd version |
4 tasks
dgrammatiko
suggested changes
Feb 20, 2023
plugins/captcha/recaptcha_invisible/src/Extension/InvisibleReCaptcha.php
Outdated
Show resolved
Hide resolved
2 tasks
Conflicts: plugins/captcha/recaptcha_invisible/src/Extension/InvisibleReCaptcha.php tests/Unit/Plugin/Captcha/InvisibleRecaptcha/Extension/InvisibleRecaptchaPluginTest.php
Member
|
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. |
Conflicts: tests/Unit/Plugin/Captcha/InvisibleRecaptcha/Extension/InvisibleRecaptchaPluginTest.php
Member
|
thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
onCaptchaSetupand an Interface forCaptchaProviderclass.While this event the plugin should register own
CaptchaProviderclass inCaptchaRegistry.The system will retrieve the requested Captcha type from that registry and call required methods, that defined by
CaptchaProviderInterfaceThis 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.phpEnable
recaptcha_invisibleand make sure it works.Testing B/C:
Enable older
recaptchaand 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: