From 1ce0a30f231ee610715d5c5ed658fe2a34af5a64 Mon Sep 17 00:00:00 2001 From: Sigrid Gramlinger Date: Fri, 28 Feb 2025 15:16:18 +0100 Subject: [PATCH 1/9] Fix mail background colour and line for Outlook (#44985) --- layouts/joomla/mail/mailtemplate.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/layouts/joomla/mail/mailtemplate.php b/layouts/joomla/mail/mailtemplate.php index 209b0ad26f570..23e680c7cdeeb 100644 --- a/layouts/joomla/mail/mailtemplate.php +++ b/layouts/joomla/mail/mailtemplate.php @@ -62,8 +62,8 @@ table, td, div, h1, p { font-family: Arial, sans-serif; } - -
+ +
From 1bc1e8fd05ac394a2580444df59ae6465cdadf7f Mon Sep 17 00:00:00 2001 From: Tuan Pham Ngoc Date: Fri, 28 Feb 2025 21:53:58 +0700 Subject: [PATCH 2/9] [5.3] Remove useless sprintf function call (#45036) --- .php-cs-fixer.dist.php | 2 ++ .../components/com_actionlogs/src/Model/ActionlogModel.php | 2 +- administrator/components/com_fields/src/Model/FieldModel.php | 2 +- administrator/components/com_finder/src/Indexer/Indexer.php | 2 +- administrator/components/com_finder/src/Indexer/Query.php | 2 +- libraries/src/Categories/Categories.php | 2 +- libraries/src/Form/Form.php | 2 +- libraries/src/Form/FormField.php | 4 ++-- libraries/src/MVC/Factory/MVCFactory.php | 4 ++-- libraries/src/MVC/Model/BaseDatabaseModel.php | 2 +- libraries/src/Menu/SiteMenu.php | 2 +- libraries/src/Table/ContentType.php | 4 ++-- 12 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 2e5cc541915e6..b188dd552c400 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -97,6 +97,8 @@ 'combine_consecutive_issets' => true, // Calling unset on multiple items should be done in one call 'combine_consecutive_unsets' => true, + // There must be no sprintf calls with only the first argument + 'no_useless_sprintf' => true, ] ) ->setFinder($finder); diff --git a/administrator/components/com_actionlogs/src/Model/ActionlogModel.php b/administrator/components/com_actionlogs/src/Model/ActionlogModel.php index 611e7578fd2c3..0a1ac8b1cd9ff 100644 --- a/administrator/components/com_actionlogs/src/Model/ActionlogModel.php +++ b/administrator/components/com_actionlogs/src/Model/ActionlogModel.php @@ -58,7 +58,7 @@ public function addLog($messages, $messageLanguageKey, $context, $userId = 0) try { $user = $userId ? $this->getUserFactory()->loadUserById($userId) : $this->getCurrentUser(); } catch (\UnexpectedValueException $e) { - @trigger_error(\sprintf('UserFactory must be set, this will not be caught anymore in 7.0.'), E_USER_DEPRECATED); + @trigger_error('UserFactory must be set, this will not be caught anymore in 7.0.', E_USER_DEPRECATED); $user = Factory::getUser($userId); } diff --git a/administrator/components/com_fields/src/Model/FieldModel.php b/administrator/components/com_fields/src/Model/FieldModel.php index db44abc384813..cdb173524567c 100644 --- a/administrator/components/com_fields/src/Model/FieldModel.php +++ b/administrator/components/com_fields/src/Model/FieldModel.php @@ -330,7 +330,7 @@ private function checkDefaultValue($data) try { $rule->setDatabase($this->getDatabase()); } catch (DatabaseNotFoundException) { - @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); + @trigger_error('Database must be set, this will not be caught anymore in 5.0.', E_USER_DEPRECATED); $rule->setDatabase(Factory::getContainer()->get(DatabaseInterface::class)); } } diff --git a/administrator/components/com_finder/src/Indexer/Indexer.php b/administrator/components/com_finder/src/Indexer/Indexer.php index 6aec4b6572342..1ed61b79faf90 100644 --- a/administrator/components/com_finder/src/Indexer/Indexer.php +++ b/administrator/components/com_finder/src/Indexer/Indexer.php @@ -122,7 +122,7 @@ class Indexer public function __construct(?DatabaseInterface $db = null) { if ($db === null) { - @trigger_error(\sprintf('Database will be mandatory in 5.0.'), E_USER_DEPRECATED); + @trigger_error('Database will be mandatory in 5.0.', E_USER_DEPRECATED); $db = Factory::getContainer()->get(DatabaseInterface::class); } diff --git a/administrator/components/com_finder/src/Indexer/Query.php b/administrator/components/com_finder/src/Indexer/Query.php index 61b1bd4cd9b5f..17838e033bdc2 100644 --- a/administrator/components/com_finder/src/Indexer/Query.php +++ b/administrator/components/com_finder/src/Indexer/Query.php @@ -208,7 +208,7 @@ class Query public function __construct($options, ?DatabaseInterface $db = null) { if ($db === null) { - @trigger_error(\sprintf('Database will be mandatory in 5.0.'), E_USER_DEPRECATED); + @trigger_error('Database will be mandatory in 5.0.', E_USER_DEPRECATED); $db = Factory::getContainer()->get(DatabaseInterface::class); } diff --git a/libraries/src/Categories/Categories.php b/libraries/src/Categories/Categories.php index 7205c7e563db2..018717fc719f6 100644 --- a/libraries/src/Categories/Categories.php +++ b/libraries/src/Categories/Categories.php @@ -237,7 +237,7 @@ protected function _load($id) try { $db = $this->getDatabase(); } catch (DatabaseNotFoundException) { - @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); + @trigger_error('Database must be set, this will not be caught anymore in 5.0.', E_USER_DEPRECATED); $db = Factory::getContainer()->get(DatabaseInterface::class); } diff --git a/libraries/src/Form/Form.php b/libraries/src/Form/Form.php index 5d7f949ef449c..db61578b72694 100644 --- a/libraries/src/Form/Form.php +++ b/libraries/src/Form/Form.php @@ -1466,7 +1466,7 @@ protected function loadField($element, $group = null, $value = null) try { $field->setDatabase($this->getDatabase()); } catch (DatabaseNotFoundException) { - @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); + @trigger_error('Database must be set, this will not be caught anymore in 5.0.', E_USER_DEPRECATED); $field->setDatabase(Factory::getContainer()->get(DatabaseInterface::class)); } } diff --git a/libraries/src/Form/FormField.php b/libraries/src/Form/FormField.php index 7e369ad7fe344..ae60376c7af0c 100644 --- a/libraries/src/Form/FormField.php +++ b/libraries/src/Form/FormField.php @@ -1218,7 +1218,7 @@ public function validate($value, $group = null, ?Registry $input = null) try { $rule->setDatabase($this->getDatabase()); } catch (DatabaseNotFoundException) { - @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); + @trigger_error('Database must be set, this will not be caught anymore in 5.0.', E_USER_DEPRECATED); $rule->setDatabase(Factory::getContainer()->get(DatabaseInterface::class)); } } @@ -1243,7 +1243,7 @@ public function validate($value, $group = null, ?Registry $input = null) try { $rule->setDatabase($this->getDatabase()); } catch (DatabaseNotFoundException) { - @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); + @trigger_error('Database must be set, this will not be caught anymore in 5.0.', E_USER_DEPRECATED); $rule->setDatabase(Factory::getContainer()->get(DatabaseInterface::class)); } } diff --git a/libraries/src/MVC/Factory/MVCFactory.php b/libraries/src/MVC/Factory/MVCFactory.php index 35fe905b69ee0..b21b3a1021f54 100644 --- a/libraries/src/MVC/Factory/MVCFactory.php +++ b/libraries/src/MVC/Factory/MVCFactory.php @@ -171,7 +171,7 @@ public function createModel($name, $prefix = '', array $config = []) try { $model->setDatabase($this->getDatabase()); } catch (DatabaseNotFoundException) { - @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); + @trigger_error('Database must be set, this will not be caught anymore in 5.0.', E_USER_DEPRECATED); $model->setDatabase(Factory::getContainer()->get(DatabaseInterface::class)); } } @@ -267,7 +267,7 @@ public function createTable($name, $prefix = '', array $config = []) try { $db = \array_key_exists('dbo', $config) ? $config['dbo'] : $this->getDatabase(); } catch (DatabaseNotFoundException) { - @trigger_error(\sprintf('Database must be set, this will not be caught anymore in 5.0.'), E_USER_DEPRECATED); + @trigger_error('Database must be set, this will not be caught anymore in 5.0.', E_USER_DEPRECATED); $db = Factory::getContainer()->get(DatabaseInterface::class); } diff --git a/libraries/src/MVC/Model/BaseDatabaseModel.php b/libraries/src/MVC/Model/BaseDatabaseModel.php index e7dbc8e27dfa2..1970f16a1e26c 100644 --- a/libraries/src/MVC/Model/BaseDatabaseModel.php +++ b/libraries/src/MVC/Model/BaseDatabaseModel.php @@ -105,7 +105,7 @@ public function __construct($config = [], ?MVCFactoryInterface $factory = null) $db = \array_key_exists('dbo', $config) ? $config['dbo'] : Factory::getDbo(); if ($db) { - @trigger_error(\sprintf('Database is not available in constructor in 6.0.'), E_USER_DEPRECATED); + @trigger_error('Database is not available in constructor in 6.0.', E_USER_DEPRECATED); $this->setDatabase($db); // Is needed, when models use the deprecated MVC DatabaseAwareTrait, as the trait is overriding the local functions diff --git a/libraries/src/Menu/SiteMenu.php b/libraries/src/Menu/SiteMenu.php index 8abedbe60af73..f99f6015006e8 100644 --- a/libraries/src/Menu/SiteMenu.php +++ b/libraries/src/Menu/SiteMenu.php @@ -72,7 +72,7 @@ public function __construct($options = []) $this->language = isset($options['language']) && $options['language'] instanceof Language ? $options['language'] : Factory::getLanguage(); if (!isset($options['db']) || !($options['db'] instanceof DatabaseDriver)) { - @trigger_error(\sprintf('Database will be mandatory in 5.0.'), E_USER_DEPRECATED); + @trigger_error('Database will be mandatory in 5.0.', E_USER_DEPRECATED); $options['db'] = Factory::getContainer()->get(DatabaseDriver::class); } diff --git a/libraries/src/Table/ContentType.php b/libraries/src/Table/ContentType.php index aedc87f793bbe..06afe016015a9 100644 --- a/libraries/src/Table/ContentType.php +++ b/libraries/src/Table/ContentType.php @@ -57,13 +57,13 @@ public function check() // Check for valid name. if (trim($this->type_title) === '') { - throw new \UnexpectedValueException(\sprintf('The title is empty')); + throw new \UnexpectedValueException('The title is empty'); } $this->type_title = ucfirst($this->type_title); if (empty($this->type_alias)) { - throw new \UnexpectedValueException(\sprintf('The type_alias is empty')); + throw new \UnexpectedValueException('The type_alias is empty'); } return true; From eb6531075e9e0880801d9736089823a4cd47b025 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Fri, 28 Feb 2025 17:23:35 +0100 Subject: [PATCH 3/9] [5.3] fine grain task notification mail (#44604) Co-authored-by: Richard Fath --- .../en-GB/plg_system_tasknotification.ini | 4 ++ .../forms/task_notification.xml | 44 ++++++++++++ .../src/Extension/TaskNotification.php | 70 ++++++++++--------- 3 files changed, 86 insertions(+), 32 deletions(-) diff --git a/administrator/language/en-GB/plg_system_tasknotification.ini b/administrator/language/en-GB/plg_system_tasknotification.ini index d94cfe5d028f5..210865e60ff7d 100644 --- a/administrator/language/en-GB/plg_system_tasknotification.ini +++ b/administrator/language/en-GB/plg_system_tasknotification.ini @@ -6,8 +6,10 @@ PLG_SYSTEM_TASK_NOTIFICATION="System - Task Notification" PLG_SYSTEM_TASK_NOTIFICATION_FAILURE_MAIL_BODY="Hello,\n\n\nPlanned execution of Scheduled Task#{TASK_ID}, {TASK_TITLE}, has failed with exit code {EXIT_CODE} at {EXEC_DATE_TIME}.\n\nPlease visit the Joomla! backend for more information.\n\n{TASK_OUTPUT}" PLG_SYSTEM_TASK_NOTIFICATION_FAILURE_MAIL_SUBJECT="Task Failure" +PLG_SYSTEM_TASK_NOTIFICATION_FAILURE_USERGROUP_LABEL="User Groups to Notify" PLG_SYSTEM_TASK_NOTIFICATION_FATAL_MAIL_BODY="Hello,\n\nPlanned execution of Scheduler Task#{TASK_ID}, {TASK_TITLE}, recovered from a fatal failure.\n\nThis could mean that the task execution exhausted the system resources or the restrictions from the PHP INI.\n\nPlease visit the Joomla! backend for more information." PLG_SYSTEM_TASK_NOTIFICATION_FATAL_MAIL_SUBJECT="Task Recover from Fatal Failure" +PLG_SYSTEM_TASK_NOTIFICATION_FATAL_USERGROUP_LABEL="User Groups to Notify" PLG_SYSTEM_TASK_NOTIFICATION_LABEL_FAILURE_MAIL_TOGGLE="Task Failure" PLG_SYSTEM_TASK_NOTIFICATION_LABEL_FATAL_FAILURE_MAIL_TOGGLE="Fatal Failures/Crashes (Recommended)" PLG_SYSTEM_TASK_NOTIFICATION_LABEL_ORPHANED_TASK_MAIL_TOGGLE="Orphaned Tasks (Recommended)" @@ -15,7 +17,9 @@ PLG_SYSTEM_TASK_NOTIFICATION_LABEL_SUCCESS_MAIL_TOGGLE="Task Success" PLG_SYSTEM_TASK_NOTIFICATION_NO_MAIL_SENT="Could not send task notification to any user. This either means that mailer is not set up properly or no user with system emails enabled, com_scheduler `core.manage` privilege exists." PLG_SYSTEM_TASK_NOTIFICATION_ORPHAN_MAIL_BODY="Hello,\n\nScheduled Task#{TASK_ID}, {TASK_TITLE}, has been orphaned. This likely means that the provider plugin was removed or disabled from your Joomla! installation.\n\nPlease visit the Joomla! backend to investigate." PLG_SYSTEM_TASK_NOTIFICATION_ORPHAN_MAIL_SUBJECT="New Orphaned Task" +PLG_SYSTEM_TASK_NOTIFICATION_ORPHAN_USERGROUP_LABEL="User Groups to Notify" PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_BODY="Hello,\n\nScheduled Task#{TASK_ID}, {TASK_TITLE}, has been successfully executed at {EXEC_DATE_TIME}.\n\n{TASK_OUTPUT}" PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_MAIL_SUBJECT="Task Successful" +PLG_SYSTEM_TASK_NOTIFICATION_SUCCESS_USERGROUP_LABEL="User Groups to Notify" PLG_SYSTEM_TASK_NOTIFICATION_USER_FETCH_FAIL="Failed to fetch users to send notifications to." PLG_SYSTEM_TASK_NOTIFICATION_XML_DESCRIPTION="Responsible for email notifications for execution of Scheduled tasks." diff --git a/plugins/system/tasknotification/forms/task_notification.xml b/plugins/system/tasknotification/forms/task_notification.xml index 15ff5aabe8743..cdc44bdd8d3c6 100644 --- a/plugins/system/tasknotification/forms/task_notification.xml +++ b/plugins/system/tasknotification/forms/task_notification.xml @@ -13,6 +13,17 @@ + + JDISABLED + + JDISABLED + + JDISABLED + + diff --git a/plugins/system/tasknotification/src/Extension/TaskNotification.php b/plugins/system/tasknotification/src/Extension/TaskNotification.php index 9097b6ab6a5a6..a2684335ffdce 100644 --- a/plugins/system/tasknotification/src/Extension/TaskNotification.php +++ b/plugins/system/tasknotification/src/Extension/TaskNotification.php @@ -134,10 +134,11 @@ public function notifyFailure(Event $event): void // Load translations $this->loadLanguage(); + $groups = $task->get('params.notifications.notification_failure_groups'); // @todo safety checks, multiple files [?] $outFile = $event->getArgument('subject')->snapshot['output_file'] ?? ''; - $this->sendMail('plg_system_tasknotification.failure_mail', $data, $outFile); + $this->sendMail('plg_system_tasknotification.failure_mail', $data, $outFile, $groups); } /** @@ -163,9 +164,10 @@ public function notifyOrphan(Event $event): void // Load translations $this->loadLanguage(); + $groups = $task->get('params.notifications.notification_orphan_groups'); $data = $this->getDataFromTask($event->getArgument('subject')); - $this->sendMail('plg_system_tasknotification.orphan_mail', $data); + $this->sendMail('plg_system_tasknotification.orphan_mail', $data, '', $groups); } /** @@ -191,10 +193,11 @@ public function notifySuccess(Event $event): void // Load translations $this->loadLanguage(); + $groups = $task->get('params.notifications.notification_success_groups'); // @todo safety checks, multiple files [?] $outFile = $event->getArgument('subject')->snapshot['output_file'] ?? ''; - $this->sendMail('plg_system_tasknotification.success_mail', $data, $outFile); + $this->sendMail('plg_system_tasknotification.success_mail', $data, $outFile, $groups); } /** @@ -204,7 +207,7 @@ public function notifySuccess(Event $event): void * * @return void * - * @since 5.3.0 + * @since __DEPLOY_VERSION__ * @throws \Exception */ public function notifyWillResume(Event $event): void @@ -236,8 +239,12 @@ public function notifyFatalRecovery(Event $event): void return; } + // Load translations + $this->loadLanguage(); + $groups = $task->get('params.notifications.notification_fatal_groups'); + $data = $this->getDataFromTask($event->getArgument('subject')); - $this->sendMail('plg_system_tasknotification.fatal_recovery_mail', $data); + $this->sendMail('plg_system_tasknotification.fatal_recovery_mail', $data, '', $groups); } /** @@ -267,13 +274,14 @@ private function getDataFromTask(Task $task): array * @param string $template The mail template. * @param array $data The data to bind to the mail template. * @param string $attachment The attachment to send with the mail (@todo multiple) + * @param array $groups The user groups to notify. * * @return void * * @since 4.1.0 * @throws \Exception */ - private function sendMail(string $template, array $data, string $attachment = ''): void + private function sendMail(string $template, array $data, string $attachment = '', array $groups = []): void { $app = $this->getApplication(); $db = $this->getDatabase(); @@ -281,10 +289,12 @@ private function sendMail(string $template, array $data, string $attachment = '' // Get all users who are not blocked and have opted in for system mails. $query = $db->getQuery(true); - $query->select($db->quoteName(['name', 'email', 'sendEmail', 'id'])) - ->from($db->quoteName('#__users')) - ->where($db->quoteName('sendEmail') . ' = 1') - ->where($db->quoteName('block') . ' = 0'); + $query->select('DISTINCT ' . $db->quoteName('u.id') . ', ' . $db->quoteName('u.email')) + ->from($db->quoteName('#__users', 'u')) + ->join('LEFT', $db->quoteName('#__user_usergroup_map', 'g') . ' ON ' . $db->quoteName('g.user_id') . ' = ' . $db->quoteName('u.id')) + ->where($db->quoteName('u.sendEmail') . ' = 1') + ->where($db->quoteName('u.block') . ' = 0') + ->whereIn($db->quoteName('g.group_id'), $groups); $db->setQuery($query); @@ -302,30 +312,26 @@ private function sendMail(string $template, array $data, string $attachment = '' $mailSent = false; - // Mail all matching users who also have the `core.manage` privilege for com_scheduler. + // Mail all matching users. foreach ($users as $user) { - $user = $this->getUserFactory()->loadUserById($user->id); - - if ($user->authorise('core.manage', 'com_scheduler')) { - try { - $mailer = new MailTemplate($template, $app->getLanguage()->getTag()); - $mailer->addTemplateData($data); - $mailer->addRecipient($user->email); - - if ( - !empty($attachment) - && is_file($attachment) - ) { - // @todo we allow multiple files [?] - $attachName = pathinfo($attachment, PATHINFO_BASENAME); - $mailer->addAttachment($attachName, $attachment); - } - - $mailer->send(); - $mailSent = true; - } catch (MailerException) { - Log::add($this->getApplication()->getLanguage()->_('PLG_SYSTEM_TASK_NOTIFICATION_NOTIFY_SEND_EMAIL_FAIL'), Log::ERROR); + try { + $mailer = new MailTemplate($template, $app->getLanguage()->getTag()); + $mailer->addTemplateData($data); + $mailer->addRecipient($user->email); + + if ( + !empty($attachment) + && is_file($attachment) + ) { + // @todo we allow multiple files [?] + $attachName = pathinfo($attachment, PATHINFO_BASENAME); + $mailer->addAttachment($attachName, $attachment); } + + $mailer->send(); + $mailSent = true; + } catch (MailerException) { + Log::add($this->getApplication()->getLanguage()->_('PLG_SYSTEM_TASK_NOTIFICATION_NOTIFY_SEND_EMAIL_FAIL'), Log::ERROR); } } From 76918b0714429e2e03d4f6cd7c3a2fa21ed1d147 Mon Sep 17 00:00:00 2001 From: Fedir Zinchuk Date: Fri, 28 Feb 2025 18:54:38 +0200 Subject: [PATCH 4/9] [5.3] CMSPlugin: Deprecate use of DispatcherAware and LanguageAware (#43430) --- libraries/src/Extension/PluginInterface.php | 2 + libraries/src/Plugin/CMSPlugin.php | 121 ++++++++++++++++-- .../content/finder/src/Extension/Finder.php | 6 +- .../codemirror/src/Extension/Codemirror.php | 6 +- plugins/editors/none/src/Extension/None.php | 6 +- .../editors/tinymce/src/Extension/TinyMCE.php | 5 +- plugins/system/cache/src/Extension/Cache.php | 6 +- .../schemaorg/src/Extension/Schemaorg.php | 7 +- .../shortcut/src/Extension/Shortcut.php | 6 +- 9 files changed, 147 insertions(+), 18 deletions(-) diff --git a/libraries/src/Extension/PluginInterface.php b/libraries/src/Extension/PluginInterface.php index 55baeb78188ed..9ac414a7d869c 100644 --- a/libraries/src/Extension/PluginInterface.php +++ b/libraries/src/Extension/PluginInterface.php @@ -19,6 +19,8 @@ * Access to plugin specific services. * * @since 4.0.0 + * + * @TODO Starting from 7.0 the class will no longer extend DispatcherAwareInterface */ interface PluginInterface extends DispatcherAwareInterface { diff --git a/libraries/src/Plugin/CMSPlugin.php b/libraries/src/Plugin/CMSPlugin.php index 8b373a758c319..8abd0c02cf9c9 100644 --- a/libraries/src/Plugin/CMSPlugin.php +++ b/libraries/src/Plugin/CMSPlugin.php @@ -14,6 +14,7 @@ use Joomla\CMS\Event\Result\ResultAwareInterface; use Joomla\CMS\Extension\PluginInterface; use Joomla\CMS\Factory; +use Joomla\CMS\Language\Language; use Joomla\CMS\Language\LanguageAwareInterface; use Joomla\CMS\Language\LanguageAwareTrait; use Joomla\Event\AbstractEvent; @@ -32,11 +33,19 @@ * Plugin Class * * @since 1.5 + * + * @TODO Starting from 7.0 the class will no longer implement DispatcherAwareInterface and LanguageAwareInterface */ abstract class CMSPlugin implements DispatcherAwareInterface, PluginInterface, LanguageAwareInterface { - use DispatcherAwareTrait; - use LanguageAwareTrait; + use DispatcherAwareTrait { + setDispatcher as traitSetDispatcher; + getDispatcher as traitGetDispatcher; + } + use LanguageAwareTrait { + setLanguage as traitSetLanguage; + getLanguage as traitGetLanguage; + } /** * A Registry object holding the parameters for the plugin @@ -101,15 +110,31 @@ abstract class CMSPlugin implements DispatcherAwareInterface, PluginInterface, L /** * Constructor * - * @param DispatcherInterface $dispatcher The event dispatcher - * @param array $config An optional associative array of configuration settings. - * Recognized key values include 'name', 'group', 'params', 'language' - * (this list is not meant to be comprehensive). + * @param array $config An optional associative array of configuration settings. + * Recognized key values include 'name', 'group', 'params', 'language' + * (this list is not meant to be comprehensive). * * @since 1.5 */ - public function __construct(DispatcherInterface $dispatcher, array $config = []) + public function __construct($config = []) { + if ($config instanceof DispatcherInterface) { + @trigger_error( + \sprintf( + 'Passing an instance of %1$s to %2$s() will not be supported in 7.0. ' + . 'Starting from 7.0 CMSPlugin class will no longer implement DispatcherAwareInterface.', + DispatcherInterface::class, + __METHOD__ + ), + \E_USER_DEPRECATED + ); + + // Set the dispatcher we are to register our listeners with + $this->setDispatcher($config); + + $config = \func_num_args() > 1 ? func_get_arg(1) : []; + } + // Get the parameters. if (isset($config['params'])) { if ($config['params'] instanceof Registry) { @@ -153,9 +178,6 @@ public function __construct(DispatcherInterface $dispatcher, array $config = []) $this->db = Factory::getDbo(); } } - - // Set the dispatcher we are to register our listeners with - $this->setDispatcher($dispatcher); } /** @@ -390,4 +412,83 @@ public function setApplication(CMSApplicationInterface $application): void $this->setLanguage($application->getLanguage()); } } + + /** + * Set the language to use. + * + * @param Language $language The language to use + * + * @return void + * + * @since __DEPLOY_VERSION__ + * + * @deprecated 5.2 will be removed in 7.0 + * Plugin should use the language from Application, and only after the app is initialised + */ + public function setLanguage(Language $language): void + { + $this->traitSetLanguage($language); + } + + /** + * Get the Language. + * + * @return Language + * + * @throws \UnexpectedValueException May be thrown if the language has not been set. + * + * @since __DEPLOY_VERSION__ + * + * @deprecated 5.2 will be removed in 7.0 + * Plugin should use the language from Application, and only after the app is initialised. + */ + protected function getLanguage(): Language + { + @trigger_error( + __CLASS__ . ': Use of LanguageAwareInterface over CMSPlugin will be removed in 7.0.', + \E_USER_DEPRECATED + ); + + return $this->traitGetLanguage(); + } + + /** + * Set the dispatcher to use. + * + * @param DispatcherInterface $dispatcher The dispatcher to use. + * + * @return $this + * + * @since __DEPLOY_VERSION__ + * + * @deprecated 5.2 will be removed in 7.0 + * Plugin should implement DispatcherAwareInterface on its own, when it is needed. + */ + public function setDispatcher(DispatcherInterface $dispatcher) + { + @trigger_error( + __CLASS__ . ': Use of DispatcherAwareInterface over CMSPlugin will be removed in 7.0.' + . ' Plugin should implement DispatcherAwareInterface on its own, when it is needed.', + \E_USER_DEPRECATED + ); + + return $this->traitSetDispatcher($dispatcher); + } + + /** + * Get the event dispatcher. + * + * @return DispatcherInterface + * + * @throws \UnexpectedValueException May be thrown if the dispatcher has not been set. + * + * @since __DEPLOY_VERSION__ + * + * @deprecated 5.2 will be removed in 7.0 + * Plugin should implement DispatcherAwareInterface on its own, when it is needed. + */ + public function getDispatcher() + { + return $this->traitGetDispatcher(); + } } diff --git a/plugins/content/finder/src/Extension/Finder.php b/plugins/content/finder/src/Extension/Finder.php index cc1f2a4746cd6..d75781ef4dcbc 100644 --- a/plugins/content/finder/src/Extension/Finder.php +++ b/plugins/content/finder/src/Extension/Finder.php @@ -14,6 +14,8 @@ use Joomla\CMS\Event\Model; use Joomla\CMS\Plugin\CMSPlugin; use Joomla\CMS\Plugin\PluginHelper; +use Joomla\Event\DispatcherAwareInterface; +use Joomla\Event\DispatcherAwareTrait; use Joomla\Event\SubscriberInterface; // phpcs:disable PSR1.Files.SideEffects @@ -25,8 +27,10 @@ * * @since 2.5 */ -final class Finder extends CMSPlugin implements SubscriberInterface +final class Finder extends CMSPlugin implements SubscriberInterface, DispatcherAwareInterface { + use DispatcherAwareTrait; + /** * Flag to check whether finder plugins already imported. * diff --git a/plugins/editors/codemirror/src/Extension/Codemirror.php b/plugins/editors/codemirror/src/Extension/Codemirror.php index 16d68593d5e7f..51e90b70b2027 100644 --- a/plugins/editors/codemirror/src/Extension/Codemirror.php +++ b/plugins/editors/codemirror/src/Extension/Codemirror.php @@ -12,6 +12,8 @@ use Joomla\CMS\Event\Editor\EditorSetupEvent; use Joomla\CMS\Plugin\CMSPlugin; +use Joomla\Event\DispatcherAwareInterface; +use Joomla\Event\DispatcherAwareTrait; use Joomla\Event\SubscriberInterface; use Joomla\Plugin\Editors\CodeMirror\Provider\CodeMirrorProvider; @@ -24,8 +26,10 @@ * * @since 1.6 */ -final class Codemirror extends CMSPlugin implements SubscriberInterface +final class Codemirror extends CMSPlugin implements SubscriberInterface, DispatcherAwareInterface { + use DispatcherAwareTrait; + /** * Returns an array of events this subscriber will listen to. * diff --git a/plugins/editors/none/src/Extension/None.php b/plugins/editors/none/src/Extension/None.php index 605fefb4dbb85..cb52c30f1de92 100644 --- a/plugins/editors/none/src/Extension/None.php +++ b/plugins/editors/none/src/Extension/None.php @@ -12,6 +12,8 @@ use Joomla\CMS\Event\Editor\EditorSetupEvent; use Joomla\CMS\Plugin\CMSPlugin; +use Joomla\Event\DispatcherAwareInterface; +use Joomla\Event\DispatcherAwareTrait; use Joomla\Event\SubscriberInterface; use Joomla\Plugin\Editors\None\Provider\EditorNoneProvider; @@ -24,8 +26,10 @@ * * @since 1.5 */ -final class None extends CMSPlugin implements SubscriberInterface +final class None extends CMSPlugin implements SubscriberInterface, DispatcherAwareInterface { + use DispatcherAwareTrait; + /** * Returns an array of events this subscriber will listen to. * diff --git a/plugins/editors/tinymce/src/Extension/TinyMCE.php b/plugins/editors/tinymce/src/Extension/TinyMCE.php index 6116faf3c00df..a6c92585b70bc 100644 --- a/plugins/editors/tinymce/src/Extension/TinyMCE.php +++ b/plugins/editors/tinymce/src/Extension/TinyMCE.php @@ -17,6 +17,8 @@ use Joomla\CMS\Session\Session; use Joomla\CMS\String\StringableInterface; use Joomla\Database\DatabaseAwareTrait; +use Joomla\Event\DispatcherAwareInterface; +use Joomla\Event\DispatcherAwareTrait; use Joomla\Event\SubscriberInterface; use Joomla\Filesystem\Folder; use Joomla\Plugin\Editors\TinyMCE\PluginTraits\KnownButtons; @@ -32,9 +34,10 @@ * * @since 1.5 */ -final class TinyMCE extends CMSPlugin implements SubscriberInterface +final class TinyMCE extends CMSPlugin implements SubscriberInterface, DispatcherAwareInterface { use DatabaseAwareTrait; + use DispatcherAwareTrait; // @todo: KnownButtons, ToolbarPresets for backward compatibility. Remove in Joomla 6 use KnownButtons; diff --git a/plugins/system/cache/src/Extension/Cache.php b/plugins/system/cache/src/Extension/Cache.php index 1f0f936fb5806..9432c925fede7 100644 --- a/plugins/system/cache/src/Extension/Cache.php +++ b/plugins/system/cache/src/Extension/Cache.php @@ -24,6 +24,8 @@ use Joomla\CMS\Profiler\Profiler; use Joomla\CMS\Router\SiteRouter; use Joomla\CMS\Uri\Uri; +use Joomla\Event\DispatcherAwareInterface; +use Joomla\Event\DispatcherAwareTrait; use Joomla\Event\DispatcherInterface; use Joomla\Event\Event; use Joomla\Event\Priority; @@ -38,8 +40,10 @@ * * @since 1.5 */ -final class Cache extends CMSPlugin implements SubscriberInterface +final class Cache extends CMSPlugin implements SubscriberInterface, DispatcherAwareInterface { + use DispatcherAwareTrait; + /** * Cache instance. * diff --git a/plugins/system/schemaorg/src/Extension/Schemaorg.php b/plugins/system/schemaorg/src/Extension/Schemaorg.php index 19344f276958a..a3c1dc7f10f4f 100644 --- a/plugins/system/schemaorg/src/Extension/Schemaorg.php +++ b/plugins/system/schemaorg/src/Extension/Schemaorg.php @@ -28,6 +28,8 @@ use Joomla\CMS\User\UserFactoryAwareTrait; use Joomla\Database\DatabaseAwareTrait; use Joomla\Database\ParameterType; +use Joomla\Event\DispatcherAwareInterface; +use Joomla\Event\DispatcherAwareTrait; use Joomla\Event\SubscriberInterface; use Joomla\Registry\Registry; @@ -40,11 +42,12 @@ * * @since 5.0.0 */ -final class Schemaorg extends CMSPlugin implements SubscriberInterface +final class Schemaorg extends CMSPlugin implements SubscriberInterface, DispatcherAwareInterface { use DatabaseAwareTrait; - use SchemaorgPrepareImageTrait; + use DispatcherAwareTrait; use SchemaorgPrepareDateTrait; + use SchemaorgPrepareImageTrait; use UserFactoryAwareTrait; /** diff --git a/plugins/system/shortcut/src/Extension/Shortcut.php b/plugins/system/shortcut/src/Extension/Shortcut.php index 8439405c24f24..2293a996384fa 100644 --- a/plugins/system/shortcut/src/Extension/Shortcut.php +++ b/plugins/system/shortcut/src/Extension/Shortcut.php @@ -16,6 +16,8 @@ use Joomla\CMS\Plugin\CMSPlugin; use Joomla\CMS\Router\Route; use Joomla\CMS\Uri\Uri; +use Joomla\Event\DispatcherAwareInterface; +use Joomla\Event\DispatcherAwareTrait; use Joomla\Event\Event; use Joomla\Event\SubscriberInterface; @@ -28,8 +30,10 @@ * * @since 4.2.0 */ -final class Shortcut extends CMSPlugin implements SubscriberInterface +final class Shortcut extends CMSPlugin implements SubscriberInterface, DispatcherAwareInterface { + use DispatcherAwareTrait; + /** * Returns an array of events this subscriber will listen to. * From e016edc14998e034c9c12cd30f9f57d19cf17725 Mon Sep 17 00:00:00 2001 From: Tuan Pham Ngoc Date: Sat, 1 Mar 2025 00:24:02 +0700 Subject: [PATCH 5/9] Fix code logic in admin controllers (#45037) --- .../components/com_banners/src/Controller/BannerController.php | 2 +- .../com_categories/src/Controller/CategoryController.php | 2 +- .../components/com_contact/src/Controller/ContactController.php | 2 +- .../components/com_content/src/Controller/ArticleController.php | 2 +- .../components/com_fields/src/Controller/FieldController.php | 2 +- .../components/com_fields/src/Controller/GroupController.php | 2 +- .../components/com_modules/src/Controller/ModuleController.php | 2 +- .../com_newsfeeds/src/Controller/NewsfeedController.php | 2 +- components/com_contact/src/Controller/ContactController.php | 2 +- components/com_content/src/Controller/ArticleController.php | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/administrator/components/com_banners/src/Controller/BannerController.php b/administrator/components/com_banners/src/Controller/BannerController.php index e221e16668f19..10b7952a8c8fd 100644 --- a/administrator/components/com_banners/src/Controller/BannerController.php +++ b/administrator/components/com_banners/src/Controller/BannerController.php @@ -71,7 +71,7 @@ protected function allowAdd($data = []) */ protected function allowEdit($data = [], $key = 'id') { - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = isset($data[$key]) ? (int) $data[$key] : 0; $categoryId = 0; if ($recordId) { diff --git a/administrator/components/com_categories/src/Controller/CategoryController.php b/administrator/components/com_categories/src/Controller/CategoryController.php index c10bc37a213b8..94764772af5de 100644 --- a/administrator/components/com_categories/src/Controller/CategoryController.php +++ b/administrator/components/com_categories/src/Controller/CategoryController.php @@ -91,7 +91,7 @@ protected function allowAdd($data = []) */ protected function allowEdit($data = [], $key = 'parent_id') { - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = isset($data[$key]) ? (int) $data[$key] : 0; $user = $this->app->getIdentity(); // Check "edit" permission on record asset (explicit or inherited) diff --git a/administrator/components/com_contact/src/Controller/ContactController.php b/administrator/components/com_contact/src/Controller/ContactController.php index 4e77dec9217b0..6ffa932fa9b2e 100644 --- a/administrator/components/com_contact/src/Controller/ContactController.php +++ b/administrator/components/com_contact/src/Controller/ContactController.php @@ -63,7 +63,7 @@ protected function allowAdd($data = []) */ protected function allowEdit($data = [], $key = 'id') { - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = isset($data[$key]) ? (int) $data[$key] : 0; // Since there is no asset tracking, fallback to the component permissions. if (!$recordId) { diff --git a/administrator/components/com_content/src/Controller/ArticleController.php b/administrator/components/com_content/src/Controller/ArticleController.php index abffcfed2f15b..96fe0cc8e6647 100644 --- a/administrator/components/com_content/src/Controller/ArticleController.php +++ b/administrator/components/com_content/src/Controller/ArticleController.php @@ -159,7 +159,7 @@ protected function allowAdd($data = []) */ protected function allowEdit($data = [], $key = 'id') { - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = isset($data[$key]) ? (int) $data[$key] : 0; $user = $this->app->getIdentity(); // Zero record (id:0), return component edit permission by calling parent controller method diff --git a/administrator/components/com_fields/src/Controller/FieldController.php b/administrator/components/com_fields/src/Controller/FieldController.php index 24682c186ce79..8401f415a7f29 100644 --- a/administrator/components/com_fields/src/Controller/FieldController.php +++ b/administrator/components/com_fields/src/Controller/FieldController.php @@ -95,7 +95,7 @@ protected function allowAdd($data = []) */ protected function allowEdit($data = [], $key = 'id') { - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = isset($data[$key]) ? (int) $data[$key] : 0; $user = $this->app->getIdentity(); // Zero record (id:0), return component edit permission by calling parent controller method diff --git a/administrator/components/com_fields/src/Controller/GroupController.php b/administrator/components/com_fields/src/Controller/GroupController.php index 6572227d11fe3..debed0279faeb 100644 --- a/administrator/components/com_fields/src/Controller/GroupController.php +++ b/administrator/components/com_fields/src/Controller/GroupController.php @@ -117,7 +117,7 @@ protected function allowAdd($data = []) */ protected function allowEdit($data = [], $key = 'parent_id') { - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = isset($data[$key]) ? (int) $data[$key] : 0; $user = $this->app->getIdentity(); // Zero record (parent_id:0), return component edit permission by calling parent controller method diff --git a/administrator/components/com_modules/src/Controller/ModuleController.php b/administrator/components/com_modules/src/Controller/ModuleController.php index 90a83929d08b9..f6b14678e9f69 100644 --- a/administrator/components/com_modules/src/Controller/ModuleController.php +++ b/administrator/components/com_modules/src/Controller/ModuleController.php @@ -141,7 +141,7 @@ protected function allowSave($data, $key = 'id') protected function allowEdit($data = [], $key = 'id') { // Initialise variables. - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = isset($data[$key]) ? (int) $data[$key] : 0; // Zero record (id:0), return component edit permission by calling parent controller method if (!$recordId) { diff --git a/administrator/components/com_newsfeeds/src/Controller/NewsfeedController.php b/administrator/components/com_newsfeeds/src/Controller/NewsfeedController.php index 1e279a399322d..e369f2c2a3ca2 100644 --- a/administrator/components/com_newsfeeds/src/Controller/NewsfeedController.php +++ b/administrator/components/com_newsfeeds/src/Controller/NewsfeedController.php @@ -68,7 +68,7 @@ protected function allowAdd($data = []) */ protected function allowEdit($data = [], $key = 'id') { - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = isset($data[$key]) ? (int) $data[$key] : 0; // Since there is no asset tracking, fallback to the component permissions. if (!$recordId) { diff --git a/components/com_contact/src/Controller/ContactController.php b/components/com_contact/src/Controller/ContactController.php index e651119c26e7a..d8b04fe06716a 100644 --- a/components/com_contact/src/Controller/ContactController.php +++ b/components/com_contact/src/Controller/ContactController.php @@ -344,7 +344,7 @@ protected function allowAdd($data = []) */ protected function allowEdit($data = [], $key = 'id') { - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = isset($data[$key]) ? (int) $data[$key] : 0; if (!$recordId) { return false; diff --git a/components/com_content/src/Controller/ArticleController.php b/components/com_content/src/Controller/ArticleController.php index 3a3e3d985f230..950f9b71a5a7c 100644 --- a/components/com_content/src/Controller/ArticleController.php +++ b/components/com_content/src/Controller/ArticleController.php @@ -124,7 +124,7 @@ protected function allowAdd($data = []) */ protected function allowEdit($data = [], $key = 'id') { - $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + $recordId = isset($data[$key]) ? (int) $data[$key] : 0; $user = $this->app->getIdentity(); // Zero record (id:0), return component edit permission by calling parent controller method From ebaced410cc3f500592bd4cf7c4412de1e05376e Mon Sep 17 00:00:00 2001 From: Tuan Pham Ngoc Date: Sat, 1 Mar 2025 18:31:52 +0700 Subject: [PATCH 6/9] Remove un-used import (#45042) --- administrator/components/com_guidedtours/tmpl/step/edit.php | 2 +- administrator/components/com_guidedtours/tmpl/tours/default.php | 2 +- .../components/com_mails/src/View/Template/HtmlView.php | 1 - libraries/src/MVC/View/ListView.php | 1 - plugins/system/cache/src/Extension/Cache.php | 1 - 5 files changed, 2 insertions(+), 5 deletions(-) diff --git a/administrator/components/com_guidedtours/tmpl/step/edit.php b/administrator/components/com_guidedtours/tmpl/step/edit.php index c47a6d07209ba..6f0fac755e907 100644 --- a/administrator/components/com_guidedtours/tmpl/step/edit.php +++ b/administrator/components/com_guidedtours/tmpl/step/edit.php @@ -13,8 +13,8 @@ use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\LayoutHelper; -use Joomla\CMS\Router\Route; use Joomla\CMS\MVC\View\GenericDataException; +use Joomla\CMS\Router\Route; /** @var \Joomla\Component\Guidedtours\Administrator\View\Step\HtmlView $this */ diff --git a/administrator/components/com_guidedtours/tmpl/tours/default.php b/administrator/components/com_guidedtours/tmpl/tours/default.php index 6b1f349b562f2..33ef8b8f550f5 100644 --- a/administrator/components/com_guidedtours/tmpl/tours/default.php +++ b/administrator/components/com_guidedtours/tmpl/tours/default.php @@ -13,8 +13,8 @@ use Joomla\CMS\Factory; use Joomla\CMS\HTML\Helpers\StringHelper; use Joomla\CMS\HTML\HTMLHelper; -use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Multilanguage; +use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; diff --git a/administrator/components/com_mails/src/View/Template/HtmlView.php b/administrator/components/com_mails/src/View/Template/HtmlView.php index f9796f4e35f6d..f13731136c781 100644 --- a/administrator/components/com_mails/src/View/Template/HtmlView.php +++ b/administrator/components/com_mails/src/View/Template/HtmlView.php @@ -15,7 +15,6 @@ use Joomla\CMS\MVC\View\GenericDataException; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Object\CMSObject; -use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\Component\Mails\Administrator\Helper\MailsHelper; use Joomla\Component\Mails\Administrator\Model\TemplateModel; diff --git a/libraries/src/MVC/View/ListView.php b/libraries/src/MVC/View/ListView.php index e5b6d0dc91bb3..e36f955f986dc 100644 --- a/libraries/src/MVC/View/ListView.php +++ b/libraries/src/MVC/View/ListView.php @@ -13,7 +13,6 @@ use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\FileLayout; -use Joomla\CMS\Toolbar\Toolbar; use Joomla\CMS\Toolbar\ToolbarHelper; use Joomla\Registry\Registry; diff --git a/plugins/system/cache/src/Extension/Cache.php b/plugins/system/cache/src/Extension/Cache.php index 9432c925fede7..6e9d04c7e812e 100644 --- a/plugins/system/cache/src/Extension/Cache.php +++ b/plugins/system/cache/src/Extension/Cache.php @@ -27,7 +27,6 @@ use Joomla\Event\DispatcherAwareInterface; use Joomla\Event\DispatcherAwareTrait; use Joomla\Event\DispatcherInterface; -use Joomla\Event\Event; use Joomla\Event\Priority; use Joomla\Event\SubscriberInterface; From 2c859aa0da3cbc075c28b8d1da2222ba84a89c5d Mon Sep 17 00:00:00 2001 From: David Jardin Date: Sat, 1 Mar 2025 13:16:48 +0100 Subject: [PATCH 7/9] [5.3] Fix core update information retrieval after changing the update channel or stability options (#44954) --- .../sql/updates/mysql/5.3.0-2025-02-22.sql | 3 + .../updates/postgresql/5.3.0-2025-02-22.sql | 3 + .../src/Controller/DisplayController.php | 3 +- .../src/Model/UpdateModel.php | 40 ++++---- .../en-GB/plg_extension_joomlaupdate.ini | 7 ++ .../en-GB/plg_extension_joomlaupdate.sys.ini | 7 ++ installation/sql/mysql/base.sql | 3 +- installation/sql/postgresql/base.sql | 3 +- .../src/Console/CoreUpdateChannelCommand.php | 2 +- libraries/src/Extension/ExtensionHelper.php | 1 + .../extension/joomlaupdate/joomlaupdate.xml | 21 +++++ .../joomlaupdate/services/provider.php | 47 ++++++++++ .../src/Extension/Joomlaupdate.php | 91 +++++++++++++++++++ 13 files changed, 205 insertions(+), 26 deletions(-) create mode 100644 administrator/components/com_admin/sql/updates/mysql/5.3.0-2025-02-22.sql create mode 100644 administrator/components/com_admin/sql/updates/postgresql/5.3.0-2025-02-22.sql create mode 100644 administrator/language/en-GB/plg_extension_joomlaupdate.ini create mode 100644 administrator/language/en-GB/plg_extension_joomlaupdate.sys.ini create mode 100644 plugins/extension/joomlaupdate/joomlaupdate.xml create mode 100644 plugins/extension/joomlaupdate/services/provider.php create mode 100644 plugins/extension/joomlaupdate/src/Extension/Joomlaupdate.php diff --git a/administrator/components/com_admin/sql/updates/mysql/5.3.0-2025-02-22.sql b/administrator/components/com_admin/sql/updates/mysql/5.3.0-2025-02-22.sql new file mode 100644 index 0000000000000..426e088ca8979 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/5.3.0-2025-02-22.sql @@ -0,0 +1,3 @@ +-- Add plg_extension_joomlaupdate plugin +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_extension_joomlaupdate', 'plugin', 'joomlaupdate', 'extension', 0, 1, 1, 0, 1, '', '', '', 0, 0); diff --git a/administrator/components/com_admin/sql/updates/postgresql/5.3.0-2025-02-22.sql b/administrator/components/com_admin/sql/updates/postgresql/5.3.0-2025-02-22.sql new file mode 100644 index 0000000000000..4f319c1a92d2d --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/5.3.0-2025-02-22.sql @@ -0,0 +1,3 @@ +-- Add plg_extension_joomlaupdate module +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_extension_joomlaupdate', 'plugin', 'joomlaupdate', 'extension', 0, 1, 1, 0, 1, '', '', '', 0, 0); diff --git a/administrator/components/com_joomlaupdate/src/Controller/DisplayController.php b/administrator/components/com_joomlaupdate/src/Controller/DisplayController.php index dba5f257ae347..2b509f3a4640f 100644 --- a/administrator/components/com_joomlaupdate/src/Controller/DisplayController.php +++ b/administrator/components/com_joomlaupdate/src/Controller/DisplayController.php @@ -76,8 +76,7 @@ public function display($cachable = false, $urlparams = false) $state->set('log_file', $this->app->get('log_path') . '/joomla_update.php'); } - // Perform update source preference check and refresh update information. - $model->applyUpdateSite(); + // Refresh update information. $model->refreshUpdates(); // Push the model into the view (as default). diff --git a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php index f9e4bea9f7b3f..780b28a1fabdb 100644 --- a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php +++ b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php @@ -85,18 +85,18 @@ public function __construct($config = [], ?MVCFactoryInterface $factory = null) * * @since 2.5.4 */ - public function applyUpdateSite() + public function applyUpdateSite(?string $updateSource = null, ?string $updateURL = null) { - // Determine the intended update URL. - $params = ComponentHelper::getParams('com_joomlaupdate'); + $params = ComponentHelper::getParams('com_joomlaupdate'); + $updateSource = $updateSource ?: $params->get('updatesource', 'default'); + $updateURL = trim($updateURL ?: $params->get('customurl', '')); - switch ($params->get('updatesource', 'default')) { + // Determine the intended update URL. + switch ($updateSource) { case 'custom': // "Custom" // @todo: check if the customurl is valid and not just "not empty". - if (trim($params->get('customurl', '')) != '') { - $updateURL = trim($params->get('customurl', '')); - } else { + if ($updateURL === '') { Factory::getApplication()->enqueueMessage(Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_CUSTOM_ERROR'), 'error'); return; @@ -134,21 +134,19 @@ public function applyUpdateSite() $db->setQuery($query); $update_site = $db->loadObject(); - if ($update_site->location !== $updateURL || $update_site->type !== $updateType) { - // Modify the database record. - $update_site->last_check_timestamp = 0; - $update_site->location = $updateURL; - $update_site->type = $updateType; - $db->updateObject('#__update_sites', $update_site, 'update_site_id'); + // Modify the database record. + $update_site->last_check_timestamp = 0; + $update_site->location = $updateURL; + $update_site->type = $updateType; + $db->updateObject('#__update_sites', $update_site, 'update_site_id'); - // Remove cached updates. - $query->clear() - ->delete($db->quoteName('#__updates')) - ->where($db->quoteName('extension_id') . ' = :id') - ->bind(':id', $id, ParameterType::INTEGER); - $db->setQuery($query); - $db->execute(); - } + // Remove cached updates. + $query->clear() + ->delete($db->quoteName('#__updates')) + ->where($db->quoteName('extension_id') . ' = :id') + ->bind(':id', $id, ParameterType::INTEGER); + $db->setQuery($query); + $db->execute(); } /** diff --git a/administrator/language/en-GB/plg_extension_joomlaupdate.ini b/administrator/language/en-GB/plg_extension_joomlaupdate.ini new file mode 100644 index 0000000000000..d096ab9d96ad8 --- /dev/null +++ b/administrator/language/en-GB/plg_extension_joomlaupdate.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_EXTENSION_JOOMLAUPDATE="Extension - Joomla! Update" +PLG_EXTENSION_JOOMLAUPDATE_XML_DESCRIPTION="Purges the core updates after release channel changes." diff --git a/administrator/language/en-GB/plg_extension_joomlaupdate.sys.ini b/administrator/language/en-GB/plg_extension_joomlaupdate.sys.ini new file mode 100644 index 0000000000000..d096ab9d96ad8 --- /dev/null +++ b/administrator/language/en-GB/plg_extension_joomlaupdate.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_EXTENSION_JOOMLAUPDATE="Extension - Joomla! Update" +PLG_EXTENSION_JOOMLAUPDATE_XML_DESCRIPTION="Purges the core updates after release channel changes." diff --git a/installation/sql/mysql/base.sql b/installation/sql/mysql/base.sql index 534493dbc12f2..db5dc5cff4aaa 100644 --- a/installation/sql/mysql/base.sql +++ b/installation/sql/mysql/base.sql @@ -288,7 +288,8 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, (0, 'plg_editors_tinymce', 'plugin', 'tinymce', 'editors', 0, 1, 1, 0, 1, '', '{"configuration":{"toolbars":{"2":{"toolbar1":["bold","underline","strikethrough","|","undo","redo","|","bullist","numlist","|","pastetext"]},"1":{"menu":["edit","insert","view","format","table","tools"],"toolbar1":["bold","italic","underline","strikethrough","|","alignleft","aligncenter","alignright","alignjustify","|","blocks","|","bullist","numlist","|","outdent","indent","|","undo","redo","|","link","unlink","anchor","code","|","hr","table","|","subscript","superscript","|","charmap","pastetext","preview"]},"0":{"menu":["edit","insert","view","format","table","tools"],"toolbar1":["bold","italic","underline","strikethrough","|","alignleft","aligncenter","alignright","alignjustify","|","styles","|","blocks","fontfamily","fontsize","|","searchreplace","|","bullist","numlist","|","outdent","indent","|","undo","redo","|","link","unlink","anchor","image","|","code","|","forecolor","backcolor","|","fullscreen","|","table","|","subscript","superscript","|","charmap","emoticons","media","hr","ltr","rtl","|","cut","copy","paste","pastetext","|","visualchars","visualblocks","nonbreaking","blockquote","jtemplate","|","print","preview","codesample","insertdatetime","removeformat"]}},"setoptions":{"2":{"access":["1"],"skin":"0","skin_admin":"0","mobile":"0","drag_drop":"1","path":"","entity_encoding":"raw","lang_mode":"1","text_direction":"ltr","content_css":"1","content_css_custom":"","relative_urls":"1","newlines":"0","use_config_textfilters":"0","invalid_elements":"script,applet,iframe","valid_elements":"","extended_elements":"","resizing":"1","resize_horizontal":"1","element_path":"1","wordcount":"1","image_advtab":"0","advlist":"1","autosave":"1","contextmenu":"1","custom_plugin":"","custom_button":""},"1":{"access":["6","2"],"skin":"0","skin_admin":"0","mobile":"0","drag_drop":"1","path":"","entity_encoding":"raw","lang_mode":"1","text_direction":"ltr","content_css":"1","content_css_custom":"","relative_urls":"1","newlines":"0","use_config_textfilters":"0","invalid_elements":"script,applet,iframe","valid_elements":"","extended_elements":"","resizing":"1","resize_horizontal":"1","element_path":"1","wordcount":"1","image_advtab":"0","advlist":"1","autosave":"1","contextmenu":"1","custom_plugin":"","custom_button":""},"0":{"access":["7","4","8"],"skin":"0","skin_admin":"0","mobile":"0","drag_drop":"1","path":"","entity_encoding":"raw","lang_mode":"1","text_direction":"ltr","content_css":"1","content_css_custom":"","relative_urls":"1","newlines":"0","use_config_textfilters":"0","invalid_elements":"script,applet,iframe","valid_elements":"","extended_elements":"","resizing":"1","resize_horizontal":"1","element_path":"1","wordcount":"1","image_advtab":"1","advlist":"1","autosave":"1","contextmenu":"1","custom_plugin":"","custom_button":""}}},"sets_amount":3,"html_height":"550","html_width":"750"}', '', 3, 0), (0, 'plg_extension_finder', 'plugin', 'finder', 'extension', 0, 1, 1, 0, 1, '', '', '', 1, 0), (0, 'plg_extension_joomla', 'plugin', 'joomla', 'extension', 0, 1, 1, 0, 1, '', '', '', 2, 0), -(0, 'plg_extension_namespacemap', 'plugin', 'namespacemap', 'extension', 0, 1, 1, 1, 1, '', '{}', '', 3, 0), +(0, 'plg_extension_joomlaupdate', 'plugin', 'joomlaupdate', 'extension', 0, 1, 1, 0, 1, '', '', '', 3, 0), +(0, 'plg_extension_namespacemap', 'plugin', 'namespacemap', 'extension', 0, 1, 1, 1, 1, '', '{}', '', 4, 0), (0, 'plg_fields_calendar', 'plugin', 'calendar', 'fields', 0, 1, 1, 0, 1, '', '', '', 1, 0), (0, 'plg_fields_checkboxes', 'plugin', 'checkboxes', 'fields', 0, 1, 1, 0, 1, '', '', '', 2, 0), (0, 'plg_fields_color', 'plugin', 'color', 'fields', 0, 1, 1, 0, 1, '', '', '', 3, 0), diff --git a/installation/sql/postgresql/base.sql b/installation/sql/postgresql/base.sql index 663718b278dfb..9a16881110208 100644 --- a/installation/sql/postgresql/base.sql +++ b/installation/sql/postgresql/base.sql @@ -294,7 +294,8 @@ INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", (0, 'plg_editors_tinymce', 'plugin', 'tinymce', 'editors', 0, 1, 1, 0, 1, '', '{"configuration":{"toolbars":{"2":{"toolbar1":["bold","underline","strikethrough","|","undo","redo","|","bullist","numlist","|","pastetext"]},"1":{"menu":["edit","insert","view","format","table","tools"],"toolbar1":["bold","italic","underline","strikethrough","|","alignleft","aligncenter","alignright","alignjustify","|","blocks","|","bullist","numlist","|","outdent","indent","|","undo","redo","|","link","unlink","anchor","code","|","hr","table","|","subscript","superscript","|","charmap","pastetext","preview"]},"0":{"menu":["edit","insert","view","format","table","tools"],"toolbar1":["bold","italic","underline","strikethrough","|","alignleft","aligncenter","alignright","alignjustify","|","styles","|","blocks","fontfamily","fontsize","|","searchreplace","|","bullist","numlist","|","outdent","indent","|","undo","redo","|","link","unlink","anchor","image","|","code","|","forecolor","backcolor","|","fullscreen","|","table","|","subscript","superscript","|","charmap","emoticons","media","hr","ltr","rtl","|","cut","copy","paste","pastetext","|","visualchars","visualblocks","nonbreaking","blockquote","jtemplate","|","print","preview","codesample","insertdatetime","removeformat"]}},"setoptions":{"2":{"access":["1"],"skin":"0","skin_admin":"0","mobile":"0","drag_drop":"1","path":"","entity_encoding":"raw","lang_mode":"1","text_direction":"ltr","content_css":"1","content_css_custom":"","relative_urls":"1","newlines":"0","use_config_textfilters":"0","invalid_elements":"script,applet,iframe","valid_elements":"","extended_elements":"","resizing":"1","resize_horizontal":"1","element_path":"1","wordcount":"1","image_advtab":"0","advlist":"1","autosave":"1","contextmenu":"1","custom_plugin":"","custom_button":""},"1":{"access":["6","2"],"skin":"0","skin_admin":"0","mobile":"0","drag_drop":"1","path":"","entity_encoding":"raw","lang_mode":"1","text_direction":"ltr","content_css":"1","content_css_custom":"","relative_urls":"1","newlines":"0","use_config_textfilters":"0","invalid_elements":"script,applet,iframe","valid_elements":"","extended_elements":"","resizing":"1","resize_horizontal":"1","element_path":"1","wordcount":"1","image_advtab":"0","advlist":"1","autosave":"1","contextmenu":"1","custom_plugin":"","custom_button":""},"0":{"access":["7","4","8"],"skin":"0","skin_admin":"0","mobile":"0","drag_drop":"1","path":"","entity_encoding":"raw","lang_mode":"1","text_direction":"ltr","content_css":"1","content_css_custom":"","relative_urls":"1","newlines":"0","use_config_textfilters":"0","invalid_elements":"script,applet,iframe","valid_elements":"","extended_elements":"","resizing":"1","resize_horizontal":"1","element_path":"1","wordcount":"1","image_advtab":"1","advlist":"1","autosave":"1","contextmenu":"1","custom_plugin":"","custom_button":""}}},"sets_amount":3,"html_height":"550","html_width":"750"}', '', 3, 0), (0, 'plg_extension_finder', 'plugin', 'finder', 'extension', 0, 1, 1, 0, 1, '', '', '', 1, 0), (0, 'plg_extension_joomla', 'plugin', 'joomla', 'extension', 0, 1, 1, 0, 1, '', '', '', 2, 0), -(0, 'plg_extension_namespacemap', 'plugin', 'namespacemap', 'extension', 0, 1, 1, 1, 1, '', '{}', '', 3, 0), +(0, 'plg_extension_joomlaupdate', 'plugin', 'joomlaupdate', 'extension', 0, 1, 1, 0, 1, '', '', '', 3, 0), +(0, 'plg_extension_namespacemap', 'plugin', 'namespacemap', 'extension', 0, 1, 1, 1, 1, '', '{}', '', 4, 0), (0, 'plg_fields_calendar', 'plugin', 'calendar', 'fields', 0, 1, 1, 0, 1, '', '', '', 1, 0), (0, 'plg_fields_checkboxes', 'plugin', 'checkboxes', 'fields', 0, 1, 1, 0, 1, '', '', '', 2, 0), (0, 'plg_fields_color', 'plugin', 'color', 'fields', 0, 1, 1, 0, 1, '', '', '', 3, 0), diff --git a/libraries/src/Console/CoreUpdateChannelCommand.php b/libraries/src/Console/CoreUpdateChannelCommand.php index 31dba413e2490..bfc9a0b7e826b 100644 --- a/libraries/src/Console/CoreUpdateChannelCommand.php +++ b/libraries/src/Console/CoreUpdateChannelCommand.php @@ -142,7 +142,7 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in /** @var UpdateModel $updatemodel */ $app = $this->getApplication(); $updatemodel = $app->bootComponent('com_joomlaupdate')->getMVCFactory($app)->createModel('Update', 'Administrator'); - $updatemodel->applyUpdateSite(); + $updatemodel->applyUpdateSite($channel); if ($channel == 'custom') { $symfonyStyle->success('The update channel for this site has been set to the custom url "' . $params->get('customurl') . '".'); diff --git a/libraries/src/Extension/ExtensionHelper.php b/libraries/src/Extension/ExtensionHelper.php index f17b506296849..db4523844ab91 100644 --- a/libraries/src/Extension/ExtensionHelper.php +++ b/libraries/src/Extension/ExtensionHelper.php @@ -206,6 +206,7 @@ class ExtensionHelper // Core plugin extensions - extension ['plugin', 'joomla', 'extension', 0], + ['plugin', 'joomlaupdate', 'extension', 0], ['plugin', 'namespacemap', 'extension', 0], ['plugin', 'finder', 'extension', 0], diff --git a/plugins/extension/joomlaupdate/joomlaupdate.xml b/plugins/extension/joomlaupdate/joomlaupdate.xml new file mode 100644 index 0000000000000..6c95354b654ec --- /dev/null +++ b/plugins/extension/joomlaupdate/joomlaupdate.xml @@ -0,0 +1,21 @@ + + + plg_extension_joomlaupdate + Joomla! Project + 2025-02 + (C) 2025 Open Source Matters, Inc. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 1.0.0 + PLG_EXTENSION_JOOMLAUPDATE_XML_DESCRIPTION + Joomla\Plugin\Extension\Joomlaupdate + + services + src + + + language/en-GB/plg_extension_joomlaupdate.ini + language/en-GB/plg_extension_joomlaupdate.sys.ini + + diff --git a/plugins/extension/joomlaupdate/services/provider.php b/plugins/extension/joomlaupdate/services/provider.php new file mode 100644 index 0000000000000..6d3c3b47c309c --- /dev/null +++ b/plugins/extension/joomlaupdate/services/provider.php @@ -0,0 +1,47 @@ + + * @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\Extension\Joomlaupdate\Extension\Joomlaupdate; + +return new class () implements ServiceProviderInterface { + /** + * Registers the service provider with a DI container. + * + * @param Container $container The DI container. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function register(Container $container) + { + $container->set( + PluginInterface::class, + function (Container $container) { + $plugin = new Joomlaupdate( + $container->get(DispatcherInterface::class), + (array) PluginHelper::getPlugin('extension', 'joomlaupdate') + ); + + $plugin->setApplication(Factory::getApplication()); + + return $plugin; + } + ); + } +}; diff --git a/plugins/extension/joomlaupdate/src/Extension/Joomlaupdate.php b/plugins/extension/joomlaupdate/src/Extension/Joomlaupdate.php new file mode 100644 index 0000000000000..3ac597a4a5e31 --- /dev/null +++ b/plugins/extension/joomlaupdate/src/Extension/Joomlaupdate.php @@ -0,0 +1,91 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\Plugin\Extension\Joomlaupdate\Extension; + +use Joomla\CMS\Event\Model\AfterSaveEvent; +use Joomla\CMS\Plugin\CMSPlugin; +use Joomla\Component\Joomlaupdate\Administrator\Model\UpdateModel; +use Joomla\Event\SubscriberInterface; +use Joomla\Registry\Registry; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * The extension plugin for com_joomlaupdate + * + * @since __DEPLOY_VERSION__ + */ +final class Joomlaupdate extends CMSPlugin implements SubscriberInterface +{ + /** + * Load the language file on instantiation. + * + * @var boolean + * + * @since __DEPLOY_VERSION__ + */ + protected $autoloadLanguage = true; + + /** + * Returns an array of events this subscriber will listen to. + * + * @return array + * + * @since __DEPLOY_VERSION__ + */ + public static function getSubscribedEvents(): array + { + return [ + 'onExtensionAfterSave' => 'onExtensionAfterSave', + ]; + } + + /** + * After update of an extension + * + * @param AfterSaveEvent $event Event instance. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function onExtensionAfterSave(AfterSaveEvent $event): void + { + $context = $event->getContext(); + $item = $event->getItem(); + + if ($context !== 'com_config.component') { + return; + } + + if ($item->element !== 'com_joomlaupdate') { + return; + } + + /** @var UpdateModel $updateModel */ + $updateModel = $this->getApplication()->bootComponent('com_joomlaupdate') + ->getMVCFactory()->createModel('Update', 'Administrator', ['ignore_request' => true]); + + if (!$updateModel) { + return; + } + + $params = new Registry($item->params); + + // Apply updated config + $updateModel->applyUpdateSite( + $params->get('updatesource'), + $params->get('customurl'), + ); + } +} From d2647bea863bb7248ccd94defd6ed6219514b576 Mon Sep 17 00:00:00 2001 From: Robert Deutz Date: Sat, 1 Mar 2025 17:33:36 +0100 Subject: [PATCH 8/9] Joomla! 5.3.0 Beta 2 --- administrator/language/en-GB/install.xml | 2 +- administrator/language/en-GB/langmetadata.xml | 2 +- administrator/manifests/files/joomla.xml | 4 ++-- administrator/manifests/packages/pkg_en-GB.xml | 2 +- api/language/en-GB/install.xml | 2 +- api/language/en-GB/langmetadata.xml | 2 +- installation/language/en-GB/langmetadata.xml | 2 +- language/en-GB/install.xml | 2 +- language/en-GB/langmetadata.xml | 2 +- libraries/src/Plugin/CMSPlugin.php | 8 ++++---- libraries/src/Version.php | 8 ++++---- plugins/extension/joomlaupdate/services/provider.php | 2 +- .../extension/joomlaupdate/src/Extension/Joomlaupdate.php | 8 ++++---- .../tasknotification/src/Extension/TaskNotification.php | 2 +- 14 files changed, 24 insertions(+), 24 deletions(-) diff --git a/administrator/language/en-GB/install.xml b/administrator/language/en-GB/install.xml index 510ae467b45ff..10fd41a445130 100644 --- a/administrator/language/en-GB/install.xml +++ b/administrator/language/en-GB/install.xml @@ -3,7 +3,7 @@ English (en-GB) en-GB 5.3.0 - 2025-02 + 2025-03 Joomla! Project admin@joomla.org www.joomla.org diff --git a/administrator/language/en-GB/langmetadata.xml b/administrator/language/en-GB/langmetadata.xml index d35d3fecf42c1..2debf87d9367e 100644 --- a/administrator/language/en-GB/langmetadata.xml +++ b/administrator/language/en-GB/langmetadata.xml @@ -2,7 +2,7 @@ English (en-GB) 5.3.0 - 2025-02 + 2025-03 Joomla! Project admin@joomla.org www.joomla.org diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index cc26db958eba0..42d731233e37b 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,8 +6,8 @@ www.joomla.org (C) 2019 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt - 5.3.0-beta2-dev - 2025-02 + 5.3.0-beta2 + 2025-03 FILES_JOOMLA_XML_DESCRIPTION administrator/components/com_admin/script.php diff --git a/administrator/manifests/packages/pkg_en-GB.xml b/administrator/manifests/packages/pkg_en-GB.xml index 20ecc7b53aaa9..f994e1cb4e7cc 100644 --- a/administrator/manifests/packages/pkg_en-GB.xml +++ b/administrator/manifests/packages/pkg_en-GB.xml @@ -3,7 +3,7 @@ English (en-GB) Language Pack en-GB 5.3.0.1 - 2025-02 + 2025-03 Joomla! Project admin@joomla.org www.joomla.org diff --git a/api/language/en-GB/install.xml b/api/language/en-GB/install.xml index 8fe1a949e3928..ff678973631c9 100644 --- a/api/language/en-GB/install.xml +++ b/api/language/en-GB/install.xml @@ -3,7 +3,7 @@ English (en-GB) en-GB 5.3.0 - 2025-02 + 2025-03 Joomla! Project admin@joomla.org www.joomla.org diff --git a/api/language/en-GB/langmetadata.xml b/api/language/en-GB/langmetadata.xml index 9acf75713686f..3721884bdc0e4 100644 --- a/api/language/en-GB/langmetadata.xml +++ b/api/language/en-GB/langmetadata.xml @@ -2,7 +2,7 @@ English (en-GB) 5.3.0 - 2025-02 + 2025-03 Joomla! Project admin@joomla.org www.joomla.org diff --git a/installation/language/en-GB/langmetadata.xml b/installation/language/en-GB/langmetadata.xml index de3af39bb5bb8..17d7e55e5741c 100644 --- a/installation/language/en-GB/langmetadata.xml +++ b/installation/language/en-GB/langmetadata.xml @@ -2,7 +2,7 @@ English (United Kingdom) 5.3.0 - 2025-02 + 2025-03 Joomla! Project (C) 2005 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/language/en-GB/install.xml b/language/en-GB/install.xml index 5df25462b5497..a3d9f158ed68d 100644 --- a/language/en-GB/install.xml +++ b/language/en-GB/install.xml @@ -3,7 +3,7 @@ English (en-GB) en-GB 5.3.0 - 2025-02 + 2025-03 Joomla! Project admin@joomla.org www.joomla.org diff --git a/language/en-GB/langmetadata.xml b/language/en-GB/langmetadata.xml index af1095dc69fc7..43f9e10517f0d 100644 --- a/language/en-GB/langmetadata.xml +++ b/language/en-GB/langmetadata.xml @@ -2,7 +2,7 @@ English (en-GB) 5.3.0 - 2025-02 + 2025-03 Joomla! Project admin@joomla.org www.joomla.org diff --git a/libraries/src/Plugin/CMSPlugin.php b/libraries/src/Plugin/CMSPlugin.php index 8abd0c02cf9c9..37a93a302106d 100644 --- a/libraries/src/Plugin/CMSPlugin.php +++ b/libraries/src/Plugin/CMSPlugin.php @@ -420,7 +420,7 @@ public function setApplication(CMSApplicationInterface $application): void * * @return void * - * @since __DEPLOY_VERSION__ + * @since 5.3.0 * * @deprecated 5.2 will be removed in 7.0 * Plugin should use the language from Application, and only after the app is initialised @@ -437,7 +437,7 @@ public function setLanguage(Language $language): void * * @throws \UnexpectedValueException May be thrown if the language has not been set. * - * @since __DEPLOY_VERSION__ + * @since 5.3.0 * * @deprecated 5.2 will be removed in 7.0 * Plugin should use the language from Application, and only after the app is initialised. @@ -459,7 +459,7 @@ protected function getLanguage(): Language * * @return $this * - * @since __DEPLOY_VERSION__ + * @since 5.3.0 * * @deprecated 5.2 will be removed in 7.0 * Plugin should implement DispatcherAwareInterface on its own, when it is needed. @@ -482,7 +482,7 @@ public function setDispatcher(DispatcherInterface $dispatcher) * * @throws \UnexpectedValueException May be thrown if the dispatcher has not been set. * - * @since __DEPLOY_VERSION__ + * @since 5.3.0 * * @deprecated 5.2 will be removed in 7.0 * Plugin should implement DispatcherAwareInterface on its own, when it is needed. diff --git a/libraries/src/Version.php b/libraries/src/Version.php index daa54a91d1320..fa3736d32a839 100644 --- a/libraries/src/Version.php +++ b/libraries/src/Version.php @@ -66,7 +66,7 @@ final class Version * @var string * @since 3.8.0 */ - public const EXTRA_VERSION = 'beta2-dev'; + public const EXTRA_VERSION = 'beta2'; /** * Development status. @@ -74,7 +74,7 @@ final class Version * @var string * @since 3.5 */ - public const DEV_STATUS = 'Development'; + public const DEV_STATUS = 'Beta'; /** * Code name. @@ -90,7 +90,7 @@ final class Version * @var string * @since 3.5 */ - public const RELDATE = '18-February-2025'; + public const RELDATE = '4-March-2025'; /** * Release time. @@ -98,7 +98,7 @@ final class Version * @var string * @since 3.5 */ - public const RELTIME = '17:01'; + public const RELTIME = '17:00'; /** * Release timezone. diff --git a/plugins/extension/joomlaupdate/services/provider.php b/plugins/extension/joomlaupdate/services/provider.php index 6d3c3b47c309c..93520836cb062 100644 --- a/plugins/extension/joomlaupdate/services/provider.php +++ b/plugins/extension/joomlaupdate/services/provider.php @@ -26,7 +26,7 @@ * * @return void * - * @since __DEPLOY_VERSION__ + * @since 5.3.0 */ public function register(Container $container) { diff --git a/plugins/extension/joomlaupdate/src/Extension/Joomlaupdate.php b/plugins/extension/joomlaupdate/src/Extension/Joomlaupdate.php index 3ac597a4a5e31..b760caebe119f 100644 --- a/plugins/extension/joomlaupdate/src/Extension/Joomlaupdate.php +++ b/plugins/extension/joomlaupdate/src/Extension/Joomlaupdate.php @@ -23,7 +23,7 @@ /** * The extension plugin for com_joomlaupdate * - * @since __DEPLOY_VERSION__ + * @since 5.3.0 */ final class Joomlaupdate extends CMSPlugin implements SubscriberInterface { @@ -32,7 +32,7 @@ final class Joomlaupdate extends CMSPlugin implements SubscriberInterface * * @var boolean * - * @since __DEPLOY_VERSION__ + * @since 5.3.0 */ protected $autoloadLanguage = true; @@ -41,7 +41,7 @@ final class Joomlaupdate extends CMSPlugin implements SubscriberInterface * * @return array * - * @since __DEPLOY_VERSION__ + * @since 5.3.0 */ public static function getSubscribedEvents(): array { @@ -57,7 +57,7 @@ public static function getSubscribedEvents(): array * * @return void * - * @since __DEPLOY_VERSION__ + * @since 5.3.0 */ public function onExtensionAfterSave(AfterSaveEvent $event): void { diff --git a/plugins/system/tasknotification/src/Extension/TaskNotification.php b/plugins/system/tasknotification/src/Extension/TaskNotification.php index a2684335ffdce..2fd2861e94549 100644 --- a/plugins/system/tasknotification/src/Extension/TaskNotification.php +++ b/plugins/system/tasknotification/src/Extension/TaskNotification.php @@ -207,7 +207,7 @@ public function notifySuccess(Event $event): void * * @return void * - * @since __DEPLOY_VERSION__ + * @since 5.3.0 * @throws \Exception */ public function notifyWillResume(Event $event): void From 279095589ffd859301d64746f877a2c505299693 Mon Sep 17 00:00:00 2001 From: Robert Deutz Date: Sun, 2 Mar 2025 17:41:11 +0100 Subject: [PATCH 9/9] reset to dev --- administrator/manifests/files/joomla.xml | 2 +- libraries/src/Version.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index 42d731233e37b..1581bfb445777 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,7 +6,7 @@ www.joomla.org (C) 2019 Open Source Matters, Inc. GNU General Public License version 2 or later; see LICENSE.txt - 5.3.0-beta2 + 5.3.0-beta3-dev 2025-03 FILES_JOOMLA_XML_DESCRIPTION diff --git a/libraries/src/Version.php b/libraries/src/Version.php index fa3736d32a839..66d3d02b85c7f 100644 --- a/libraries/src/Version.php +++ b/libraries/src/Version.php @@ -66,7 +66,7 @@ final class Version * @var string * @since 3.8.0 */ - public const EXTRA_VERSION = 'beta2'; + public const EXTRA_VERSION = 'beta3-dev'; /** * Development status. @@ -74,7 +74,7 @@ final class Version * @var string * @since 3.5 */ - public const DEV_STATUS = 'Beta'; + public const DEV_STATUS = 'Development'; /** * Code name. @@ -98,7 +98,7 @@ final class Version * @var string * @since 3.5 */ - public const RELTIME = '17:00'; + public const RELTIME = '17:01'; /** * Release timezone.
@@ -83,8 +83,14 @@ -
-
+ + + + + + + +