Skip to content

[6.0] Behaviour plugin group no longer loads before system plugins, breaking backwards compatibility #46233

Description

@ercanozkaya

Steps to reproduce the issue

  1. Ensure Behaviour - Backward Compatibility 6 plugin is enabled.
  2. 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.
  3. Load the site or administrator area.
  4. 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);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions