Skip to content

[6.2] [RFC] CMSPlugin: Subscriber Registration Checker Interface#43657

Draft
Fedik wants to merge 11 commits intojoomla:6.2-devfrom
Fedik:plg-registerlistener-checker
Draft

[6.2] [RFC] CMSPlugin: Subscriber Registration Checker Interface#43657
Fedik wants to merge 11 commits intojoomla:6.2-devfrom
Fedik:plg-registerlistener-checker

Conversation

@Fedik
Copy link
Copy Markdown
Member

@Fedik Fedik commented Jun 15, 2024

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

public function onBeforeCompileHead()
{
$app = $this->getApplication();

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:

@Fedik Fedik added the Feature label Jun 15, 2024
@Fedik Fedik changed the title [5.2] CMSPlugin: Subscriber Registration Checker Interface [5.2][RFC] CMSPlugin: Subscriber Registration Checker Interface Jun 15, 2024
@joomla-cms-bot joomla-cms-bot added the RFC Request for Comment label Jun 15, 2024
@Fedik Fedik changed the title [5.2][RFC] CMSPlugin: Subscriber Registration Checker Interface [5.x][RFC] CMSPlugin: Subscriber Registration Checker Interface Jun 15, 2024
@HLeithner HLeithner changed the base branch from 5.2-dev to 5.3-dev September 2, 2024 08:51
@HLeithner
Copy link
Copy Markdown
Member

This pull request has been automatically rebased to 5.3-dev.

@HLeithner HLeithner changed the title [5.x][RFC] CMSPlugin: Subscriber Registration Checker Interface [5.3] [RFC] CMSPlugin: Subscriber Registration Checker Interface Sep 2, 2024
 Conflicts:
	plugins/system/guidedtours/src/Extension/GuidedTours.php
@HLeithner
Copy link
Copy Markdown
Member

This pull request has been automatically rebased to 6.0-dev.

@HLeithner HLeithner changed the title [5.3] [RFC] CMSPlugin: Subscriber Registration Checker Interface [6.0] [RFC] CMSPlugin: Subscriber Registration Checker Interface Mar 4, 2025
@rdeutz rdeutz removed the PR-5.3-dev label Mar 5, 2025
@HLeithner HLeithner changed the base branch from 6.0-dev to 6.1-dev August 31, 2025 11:58
@HLeithner
Copy link
Copy Markdown
Member

This pull request has been automatically rebased to 6.1-dev.

@HLeithner HLeithner changed the title [6.0] [RFC] CMSPlugin: Subscriber Registration Checker Interface [6.1] [RFC] CMSPlugin: Subscriber Registration Checker Interface Aug 31, 2025
@Fedik Fedik removed the PR-6.0-dev label Oct 19, 2025
Fedik added 3 commits October 19, 2025 14:22
 Conflicts:
	plugins/system/guidedtours/src/Extension/GuidedTours.php
 Conflicts:
	libraries/src/Plugin/PluginHelper.php
@Fedik Fedik marked this pull request as draft February 15, 2026 10:23
@HLeithner
Copy link
Copy Markdown
Member

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.

@Fedik
Copy link
Copy Markdown
Member Author

Fedik commented Feb 15, 2026

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 PluginRegistrationChecker first and only then for plugin.
But with current architecture it is not possible, and the checker need to be part of PluginInterface.

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.

@HLeithner HLeithner changed the base branch from 6.1-dev to 6.2-dev March 17, 2026 09:27
@HLeithner
Copy link
Copy Markdown
Member

This pull request has been automatically rebased to 6.2-dev.

@tecpromotion tecpromotion changed the title [6.1] [RFC] CMSPlugin: Subscriber Registration Checker Interface [6.2] [RFC] CMSPlugin: Subscriber Registration Checker Interface Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature PR-6.2-dev RFC Request for Comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants