diff --git a/administrator/components/com_admin/sql/updates/mysql/5.4.0-2025-04-23.sql b/administrator/components/com_admin/sql/updates/mysql/5.4.0-2025-04-23.sql new file mode 100644 index 0000000000000..a806087e70d86 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/5.4.0-2025-04-23.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) VALUES +(0, 'plg_behaviour_compat6', 'plugin', 'compat6', 'behaviour', 0, 1, 1, 0, 1, '', '{}', '', -1, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/5.4.0-2025-04-23.sql b/administrator/components/com_admin/sql/updates/postgresql/5.4.0-2025-04-23.sql new file mode 100644 index 0000000000000..7252ac4a984ad --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/5.4.0-2025-04-23.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES +(0, 'plg_behaviour_compat6', 'plugin', 'compat6', 'behaviour', 0, 1, 1, 0, 1, '', '{}', '', -1, 0); diff --git a/administrator/language/en-GB/plg_behaviour_compat6.ini b/administrator/language/en-GB/plg_behaviour_compat6.ini new file mode 100644 index 0000000000000..d550624dcc1b9 --- /dev/null +++ b/administrator/language/en-GB/plg_behaviour_compat6.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; (C) 2025 Open Source Matters, Inc. +; License GNU General Public License version 2 or later; see LICENSE.txt +; Note : All ini files need to be saved as UTF-8 + +PLG_BEHAVIOUR_COMPAT6="Behaviour - Backward Compatibility 6" +PLG_COMPAT6_XML_DESCRIPTION="This plugin should be enabled before updating to Joomla 6." diff --git a/administrator/language/en-GB/plg_behaviour_compat6.sys.ini b/administrator/language/en-GB/plg_behaviour_compat6.sys.ini new file mode 100644 index 0000000000000..d550624dcc1b9 --- /dev/null +++ b/administrator/language/en-GB/plg_behaviour_compat6.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; (C) 2025 Open Source Matters, Inc. +; License GNU General Public License version 2 or later; see LICENSE.txt +; Note : All ini files need to be saved as UTF-8 + +PLG_BEHAVIOUR_COMPAT6="Behaviour - Backward Compatibility 6" +PLG_COMPAT6_XML_DESCRIPTION="This plugin should be enabled before updating to Joomla 6." diff --git a/installation/sql/mysql/base.sql b/installation/sql/mysql/base.sql index db5dc5cff4aaa..18229e47d24f7 100644 --- a/installation/sql/mysql/base.sql +++ b/installation/sql/mysql/base.sql @@ -263,8 +263,9 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, (0, 'plg_authentication_joomla', 'plugin', 'joomla', 'authentication', 0, 1, 1, 1, 1, '', '', '', 2, 0), (0, 'plg_authentication_ldap', 'plugin', 'ldap', 'authentication', 0, 0, 1, 0, 1, '', '{"host":"","port":"389","use_ldapV3":"0","negotiate_tls":"0","no_referrals":"0","auth_method":"bind","base_dn":"","search_string":"","users_dn":"","username":"admin","password":"bobby7","ldap_fullname":"fullName","ldap_email":"mail","ldap_uid":"uid"}', '', 3, 0), (0, 'plg_behaviour_compat', 'plugin', 'compat', 'behaviour', 0, 1, 1, 0, 1, '', '{"classes_aliases":"1","es5_assets":"1"}', '', 1, 0), -(0, 'plg_behaviour_taggable', 'plugin', 'taggable', 'behaviour', 0, 1, 1, 0, 1, '', '{}', '', 2, 0), -(0, 'plg_behaviour_versionable', 'plugin', 'versionable', 'behaviour', 0, 1, 1, 0, 1, '', '{}', '', 3, 0), +(0, 'plg_behaviour_compat6', 'plugin', 'compat6', 'behaviour', 0, 1, 1, 0, 1, '', '{}', '', 2, 0), +(0, 'plg_behaviour_taggable', 'plugin', 'taggable', 'behaviour', 0, 1, 1, 0, 1, '', '{}', '', 3, 0), +(0, 'plg_behaviour_versionable', 'plugin', 'versionable', 'behaviour', 0, 1, 1, 0, 1, '', '{}', '', 4, 0), (0, 'plg_content_confirmconsent', 'plugin', 'confirmconsent', 'content', 0, 0, 1, 0, 1, '', '{}', '', 1, 0), (0, 'plg_content_contact', 'plugin', 'contact', 'content', 0, 1, 1, 0, 1, '', '', '', 2, 0), (0, 'plg_content_emailcloak', 'plugin', 'emailcloak', 'content', 0, 1, 1, 0, 1, '', '{"mode":"1"}', '', 3, 0), diff --git a/installation/sql/postgresql/base.sql b/installation/sql/postgresql/base.sql index 9a16881110208..59230f2c02a82 100644 --- a/installation/sql/postgresql/base.sql +++ b/installation/sql/postgresql/base.sql @@ -269,8 +269,9 @@ INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", (0, 'plg_authentication_joomla', 'plugin', 'joomla', 'authentication', 0, 1, 1, 1, 1, '', '', '', 2, 0), (0, 'plg_authentication_ldap', 'plugin', 'ldap', 'authentication', 0, 0, 1, 0, 1, '', '{"host":"","port":"389","use_ldapV3":"0","negotiate_tls":"0","no_referrals":"0","auth_method":"bind","base_dn":"","search_string":"","users_dn":"","username":"admin","password":"bobby7","ldap_fullname":"fullName","ldap_email":"mail","ldap_uid":"uid"}', '', 3, 0), (0, 'plg_behaviour_compat', 'plugin', 'compat', 'behaviour', 0, 1, 1, 0, 1, '', '{"classes_aliases":"1","es5_assets":"1"}', '', 1, 0), -(0, 'plg_behaviour_taggable', 'plugin', 'taggable', 'behaviour', 0, 1, 1, 0, 1, '', '{}', '', 2, 0), -(0, 'plg_behaviour_versionable', 'plugin', 'versionable', 'behaviour', 0, 1, 1, 0, 1, '', '{}', '', 3, 0), +(0, 'plg_behaviour_compat6', 'plugin', 'compat6', 'behaviour', 0, 1, 1, 0, 1, '', '{}', '', 2, 0), +(0, 'plg_behaviour_taggable', 'plugin', 'taggable', 'behaviour', 0, 1, 1, 0, 1, '', '{}', '', 3, 0), +(0, 'plg_behaviour_versionable', 'plugin', 'versionable', 'behaviour', 0, 1, 1, 0, 1, '', '{}', '', 4, 0), (0, 'plg_content_confirmconsent', 'plugin', 'confirmconsent', 'content', 0, 0, 1, 0, 1, '', '{}', '', 1, 0), (0, 'plg_content_contact', 'plugin', 'contact', 'content', 0, 1, 1, 0, 1, '', '', '', 2, 0), (0, 'plg_content_emailcloak', 'plugin', 'emailcloak', 'content', 0, 1, 1, 0, 1, '', '{"mode":"1"}', '', 3, 0), diff --git a/libraries/src/Extension/ExtensionHelper.php b/libraries/src/Extension/ExtensionHelper.php index db4523844ab91..561650f5a5fc7 100644 --- a/libraries/src/Extension/ExtensionHelper.php +++ b/libraries/src/Extension/ExtensionHelper.php @@ -174,6 +174,7 @@ class ExtensionHelper // Core plugin extensions - behaviour ['plugin', 'compat', 'behaviour', 0], + ['plugin', 'compat6', 'behaviour', 0], ['plugin', 'taggable', 'behaviour', 0], ['plugin', 'versionable', 'behaviour', 0], diff --git a/plugins/behaviour/compat6/compat6.xml b/plugins/behaviour/compat6/compat6.xml new file mode 100644 index 0000000000000..793dbd5a761b3 --- /dev/null +++ b/plugins/behaviour/compat6/compat6.xml @@ -0,0 +1,21 @@ + + + plg_behaviour_compat6 + Joomla! Project + 2025-04 + (C) 2025 Open Source Matters, Inc. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 5.4.0 + PLG_COMPAT6_XML_DESCRIPTION + Joomla\Plugin\Behaviour\Compat6 + + services + src + + + language/en-GB/plg_behaviour_compat6.ini + language/en-GB/plg_behaviour_compat6.sys.ini + + diff --git a/plugins/behaviour/compat6/services/provider.php b/plugins/behaviour/compat6/services/provider.php new file mode 100644 index 0000000000000..cf9708aca13c4 --- /dev/null +++ b/plugins/behaviour/compat6/services/provider.php @@ -0,0 +1,45 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +\defined('_JEXEC') or die; + +use Joomla\CMS\Extension\PluginInterface; +use Joomla\CMS\Factory; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\DI\Container; +use Joomla\DI\ServiceProviderInterface; +use Joomla\Event\DispatcherInterface; +use Joomla\Plugin\Behaviour\Compat6\Extension\Compat6; + +return new class () implements ServiceProviderInterface { + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * @since 5.4.0 + */ + public function register(Container $container) + { + $container->set( + PluginInterface::class, + function (Container $container) { + $plugin = PluginHelper::getPlugin('behaviour', 'compat6'); + $dispatcher = $container->get(DispatcherInterface::class); + + $plugin = new Compat6($dispatcher, (array) $plugin); + $plugin->setApplication(Factory::getApplication()); + + return $plugin; + } + ); + } +}; diff --git a/plugins/behaviour/compat6/src/Extension/Compat6.php b/plugins/behaviour/compat6/src/Extension/Compat6.php new file mode 100644 index 0000000000000..b4ad8bf437862 --- /dev/null +++ b/plugins/behaviour/compat6/src/Extension/Compat6.php @@ -0,0 +1,41 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\Plugin\Behaviour\Compat6\Extension; + +use Joomla\CMS\Plugin\CMSPlugin; +use Joomla\Event\SubscriberInterface; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Joomla! Compat6 Plugin. + * + * @since 5.4.0 + */ +final class Compat6 extends CMSPlugin implements SubscriberInterface +{ + /** + * Returns an array of CMS events this plugin will listen to and the respective handlers. + * + * @return array + * + * @since 5.4.0 + */ + public static function getSubscribedEvents(): array + { + /** + * This plugin does not listen to any events. + */ + return []; + } +}