Skip to content
Merged
2 changes: 2 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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);
Original file line number Diff line number Diff line change
@@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_finder/src/Indexer/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
40 changes: 19 additions & 21 deletions administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 7 additions & 0 deletions administrator/language/en-GB/plg_extension_joomlaupdate.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
; Joomla! Project
; (C) 2025 Open Source Matters, Inc. <https://www.joomla.org>
; 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."
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
; Joomla! Project
; (C) 2025 Open Source Matters, Inc. <https://www.joomla.org>
; 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."
4 changes: 4 additions & 0 deletions administrator/language/en-GB/plg_system_tasknotification.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@
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)"
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."
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion installation/sql/mysql/base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Loading