No Code Attached Yet
avatar Septdir
Septdir
20 May 2024

Greetings to our dear and beloved Joomla community, how are you doing? How's the weather?
It's summer outside my window, and summer is a great time to update one’s extensions.

That's what I decided to do and encountered a number of issues related to plugin triggers.
Overall, I liked the idea that in a system plugin I could enjoy using it, but not all new triggers are available in Joomla 4, some just don't exist, and others are not accessible from the system plugin in Joomla 4.

It's particularly disappointing that in Joomla 4, unlike Joomla 5, I can't add authentication functions to the system plugin, and I really wanted to be able to access client sites in the shortcode plugin.

But I'm getting ahead of myself, my apologies, let's get to the specifics.

About the triggers:

  1. onUserAuthenticate - Is it planned to make this available in system plugins in Joomla 4?
  2. onUserAuthenticate - Is there a plan to replace the arguments in the trigger with AuthenticationEvent? As it stands, I have to maintain two implementations in one plugin with a Joomla version check.
  3. onEditorButtonsSetup - Is there a plan to add this to Joomla 4, as currently, I have to maintain a plugin on Joomla 3 architecture for compatibility in Joomla 4. Whereas in Joomla 5, I can use onEditorButtonsSetup right in the system plugin.
  4. Languages. There are two issues here.
    4.1 Is there a plan to add a ->getLanguage method or generally a language trait to CMSPlugin in Joomla 4?
    4.2 Is there a plan to fix the issue with connecting languages?
    When Text:: uses Factory::$_language but according to the new standard, languages need to be loaded in Factory::getApplication->getLanguage()?
avatar Septdir Septdir - open - 20 May 2024
avatar joomla-cms-bot joomla-cms-bot - change - 20 May 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 May 2024
avatar brianteeman
brianteeman - comment - 22 Jul 2024

Can you confirm that I have understood correctly. You can do something in joomla 5 but you cannot do the same in Joomla 4. If I have understood correctly then I would call that expected behaviour. New features are added in new releases. Bugs are fixed in all releases.

avatar Septdir
Septdir - comment - 22 Jul 2024

You understood correctly. However, in the given example, this is a problem of compatibility between Joomla 4 and Joomla 5 plugins.
To simplify, a plugin written for Joomla 4 will not work in Joomla 5, and vice versa, a plugin written for Joomla 5 will not work in Joomla 4.
You either have to check the Joomla version in the plugin and create two independent methods, or create two separate plugins.

And this can cause unpleasant problems during the update after the end of Joomla 4 support.

Joomla 4x
https://github.com/joomla/joomla-cms/blob/4.4-dev/libraries/src/Authentication/Authentication.php#L175

Joomla 5x
https://github.com/joomla/joomla-cms/blob/5.1-dev/libraries/src/Authentication/Authentication.php#L162

avatar Septdir
Septdir - comment - 22 Jul 2024

As for languages, it actually looks more like a bug.

avatar brianteeman
brianteeman - comment - 22 Jul 2024

You either have to check the Joomla version in the plugin and create two independent methods, or create two separate plugins.

This is what I would expect

avatar Hackwar Hackwar - change - 28 Jul 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-07-28 21:27:32
Closed_By Hackwar
avatar Hackwar Hackwar - close - 28 Jul 2024
avatar Hackwar
Hackwar - comment - 28 Jul 2024

All the things you are requesting are new features in Joomla 4 and Joomla 4 IS in Bugfix Mode only. With the release of 5.2 we will even switch Joomla 4.4 into security fixes only mode, so none of these things will be refactored.

Add a Comment

Login with GitHub to post a comment