Steps to reproduce the issue
- Ensure
Behaviour - Backward Compatibility 6 plugin is enabled.
- Either modify any system plugin so that the class definition reads as
class PlgSystemFoo extends JPlugin OR install and enable the attached plg_system_reproduce.zip package.
- Load the site or administrator area.
- Observe that the plugin fails or throws errors (
Class "JPlugin" not found) because the expected BC layer has not been initialized yet.
Expected result
- The behaviour plugin group should always load before the system plugin group to maintain backwards compatibility, as it did in Joomla 5.x.
Actual result
- system plugins load first, causing failures for any plugin expecting BC behaviour to be available.
System information (as much as possible)
- Joomla 6.0-rc-1 with
Behaviour - Backward Compatibility 6 plugin enabled.
- Any system plugin that depends on the above plugin either in its definition or its constructor.
Additional comments
In Joomla 6.0 RC1, a change introduced in #45426 has altered the plugin loading order, resulting in a major backwards compatibility problem.
Previously, the behaviour plugin group was loaded before the system plugins.
This ensured that behaviour (most importantly Behaviour - Backward Compatibility 6) were available for any system plugin relying on them.
However, PR #45426 now loads system plugins first, and behaviour plugins later.
As a result, system plugins depending on Backwards compatibility behaviours are no longer functional, breaking compatibility with existing extensions. Specifically, any system plugin extending from JPlugin
or any system plugin that uses legacy classes such as JFactory in its constructor
will fail, breaking both the site and administrator areas.
plg_system_reproduce.zip
Code for the above plugin
<?php
// JPlugin does not exist yet when this file is loaded
class PlgSystemReproduce extends JPlugin
{
public function __construct($subject, $config = array())
{
// JFactory does not exist in system plugin constructors
var_dump(JFactory::getUser()->guest);
parent::__construct($subject, $config);
}
}
Steps to reproduce the issue
Behaviour - Backward Compatibility 6plugin is enabled.class PlgSystemFoo extends JPluginOR install and enable the attached plg_system_reproduce.zip package.Class "JPlugin" not found) because the expected BC layer has not been initialized yet.Expected result
Actual result
System information (as much as possible)
Behaviour - Backward Compatibility 6plugin enabled.Additional comments
In Joomla 6.0 RC1, a change introduced in #45426 has altered the plugin loading order, resulting in a major backwards compatibility problem.
Previously, the behaviour plugin group was loaded before the system plugins.
This ensured that behaviour (most importantly Behaviour - Backward Compatibility 6) were available for any system plugin relying on them.
However, PR #45426 now loads system plugins first, and behaviour plugins later.
As a result, system plugins depending on Backwards compatibility behaviours are no longer functional, breaking compatibility with existing extensions. Specifically, any system plugin extending from JPlugin
or any system plugin that uses legacy classes such as JFactory in its constructor
will fail, breaking both the site and administrator areas.
plg_system_reproduce.zip
Code for the above plugin