[6.2] [RFC] CMSPlugin: Subscriber Registration Checker Interface#43657
[6.2] [RFC] CMSPlugin: Subscriber Registration Checker Interface#43657Fedik wants to merge 11 commits intojoomla:6.2-devfrom
Conversation
|
This pull request has been automatically rebased to 5.3-dev. |
Conflicts: plugins/system/guidedtours/src/Extension/GuidedTours.php
|
This pull request has been automatically rebased to 6.0-dev. |
Conflicts: libraries/src/Plugin/PluginHelper.php
|
This pull request has been automatically rebased to 6.1-dev. |
Conflicts: plugins/system/guidedtours/src/Extension/GuidedTours.php
Conflicts: libraries/src/Plugin/PluginHelper.php
|
It's a bit contra productive if the check function gets no information about where to register. We have the situation that we might not have an own dispatcher we want the plugin to register. Or we boot the plugin for the SiteRouter in the backend (see autoredirect plugin). I also think it should be static so it doesn't access the plugin object it self. More might be provided to the plugin to get a qualified answer to the "should register" question. |
|
Initially I wanted detached handler. Then service provider could be: $container->set(PluginRegistrationChecker::class, function() {
return true/false;
});
$container->set(PluginInterface::class, function() {
// our existing code for plugin initialisation
});Then plugin helper checking for Also the idea that checker can access to the plugin parameters. We have plugin that can be configured to run: site/admin/both (example skipto plugin). I set it to draft for now. Maybe later we will get a better idea. |
|
This pull request has been automatically rebased to 6.2-dev. |
Summary of Changes
Adding Subscriber Registration Checker. Interface that allows Plugins to be checked before listener registration.
This allows the plugin to be registered only wheen special conditions are met, eg: only for specific application.
Testing Instructions
Code review by maintainers.
Edit
joomla-cms/plugins/system/guidedtours/src/Extension/GuidedTours.php
Lines 124 to 126 in 98f3ecd
And add
dd('Works');at top of this method.Then open Administrator page: you should get message "works"
And then open Site page: the page should be opened as usual
Link to documentations
Please select: