Skip to content

Commit

Permalink
Merge branch '5.2-dev' into media-folder-select
Browse files Browse the repository at this point in the history
  • Loading branch information
Quy authored Jul 11, 2024
2 parents ec13934 + 68d434c commit 3223f82
Show file tree
Hide file tree
Showing 136 changed files with 1,841 additions and 676 deletions.
4 changes: 2 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ steps:
environment:
CYPRESS_VERIFY_TIMEOUT: 100000
commands:
- mv cypress.config.dist.js cypress.config.js
- mv cypress.config.dist.mjs cypress.config.mjs
- npx cypress install
- npx cypress verify

Expand Down Expand Up @@ -414,6 +414,6 @@ trigger:

---
kind: signature
hmac: 8f1bbc362aaadc6b7506490a1ff865bc9ccc0aada27104646963e9b44ee22bef
hmac: bd41423d85abadb875c8fc911f87596ead88b62d26fabf6a283737c5a7b4c5b9

...
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ RoboFile.ini
!/tests/System/output/screenshots/.gitkeep
/tests/System/output/videos
!/tests/System/output/videos/.gitkeep
cypress.config.js
cypress.config.mjs

# WebAuthn FIDO metadata cache
/plugins/system/webauthn/fido.jwt
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The Joomla! 5.2 branch is under heavy development and not all links in this docu
------------------------------------------------------------------------------------------------------

Build Status
---------------------

| Drone-CI | AppVeyor | PHP | Node | npm |
|------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
| [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg?branch=5.2-dev)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/5.2-dev?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | [![PHP](https://img.shields.io/badge/PHP-V8.1.0-green)](https://www.php.net/) | [![node-lts](https://img.shields.io/badge/Node-V18.0-green)](https://nodejs.org/en/) | [![npm](https://img.shields.io/badge/npm-v9.6.7-green)](https://nodejs.org/en/) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
echo ModuleHelper::renderModule($module, ['style' => 'well']);
}
?>
<?php if ($user->authorise('core.create', 'com_modules')) : ?>
<?php if ($user->authorise('core.admin', 'com_modules') && $user->authorise('core.create', 'com_modules')) : ?>
<div class="module-wrapper">
<div class="card">
<button type="button" class="cpanel-add-module"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public function display($cachable = false, $urlparams = false)
$state = $model->getState();
$state->set('update_finished_with_error', $this->app->getUserState('com_joomlaupdate.update_finished_with_error'));
$state->set('update_errors', (array) $this->app->getUserState('com_joomlaupdate.update_errors', []));
$state->set('update_channel_reset', $this->app->getUserState('com_joomlaupdate.update_channel_reset'));
$state->set('installer_message', $this->app->getUserState('com_joomlaupdate.installer_message'));
$state->set('log_file', $this->app->get('log_path') . '/joomla_update.php');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ public function finalise()
$model->collectError('finaliseUpgrade', $e);
}

// Reset update source from "Joomla Next" to "Default"
$this->app->setUserState('com_joomlaupdate.update_channel_reset', $model->resetUpdateSource());

// Check for update errors
if ($model->getErrors()) {
// The errors already should be logged at this point
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2027,4 +2027,73 @@ private function checkManifestXML(string $manifest, $packageName)
throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_DOWNGRADE', $packageName, $versionPackage, $currentVersion), 500);
}
}

/**
* Reset update source from "next" to "default"
*
* @return boolean True if update source is reset, false if reset failed with error,
* null if no reset was necessary.
*
* @since 5.1.2
*/
public function resetUpdateSource()
{
// Get current update source
$params = ComponentHelper::getParams('com_joomlaupdate');

// Do nothing if not "next"
if ($params->get('updatesource', 'default') !== 'next') {
return null;
}

$params->set('updatesource', 'default');

$params = $params->toString();
$db = $this->getDatabase();
$query = $db->getQuery(true)
->update($db->quoteName('#__extensions'))
->set($db->quoteName('params') . ' = :params')
->where($db->quoteName('type') . ' = ' . $db->quote('component'))
->where($db->quoteName('element') . ' = ' . $db->quote('com_joomlaupdate'))
->bind(':params', $params);

try {
$db->setQuery($query);
$db->execute();
} catch (\Exception $e) {
Log::add(
sprintf(
'An error has occurred while running "resetUpdateSource". Code: %s. Message: %s.',
$e->getCode(),
$e->getMessage()
),
Log::WARNING,
'Update'
);

Log::add(
Text::sprintf(
'COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_FAILED',
Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_NEXT'),
Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_DEFAULT')
),
Log::WARNING,
'Update'
);

return false;
}

Log::add(
Text::sprintf(
'COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_OK',
Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_NEXT'),
Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_DEFAULT')
),
Log::INFO,
'Update'
);

return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

$hadErrors = $this->state->get('update_finished_with_error');
$errors = $this->state->get('update_errors');
$channelReset = $this->state->get('update_channel_reset');
$logFile = $this->state->get('log_file');
$installerMsg = $this->state->get('installer_message');
$forumLink = '<a href="https://forum.joomla.org/" target="_blank" rel="noopener noreferrer">https://forum.joomla.org/</a>';
Expand All @@ -27,6 +28,17 @@
<div class="card">
<h2 class="card-header"><?php echo Text::_('COM_JOOMLAUPDATE_VIEW_COMPLETE_HEADING'); ?></h2>
<div class="card-body">
<?php if ($channelReset) : ?>
<div class="alert alert-success">
<span class="icon-check-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('NOTICE'); ?></span>
<?php echo Text::sprintf('COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_OK', Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_NEXT'), Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_DEFAULT')); ?>
</div>
<?php elseif ($channelReset !== null) : ?>
<div class="alert alert-warning">
<span class="icon-check-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
<?php echo Text::sprintf('COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_FAILED', Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_NEXT'), Text::_('COM_JOOMLAUPDATE_CONFIG_UPDATESOURCE_DEFAULT')); ?>
</div>
<?php endif; ?>
<?php if (!$hadErrors) : ?>
<div class="alert alert-success">
<span class="icon-check-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('NOTICE'); ?></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
type="list"
label="JGLOBAL_SORT_BY"
class="js-select-submit-on-change"
default="a.title ASC"
default="a.next_execution ASC"
validate="options"
>
<option value="">JGLOBAL_SORT_BY</option>
Expand All @@ -59,6 +59,8 @@
<option value="j.type_title DESC">COM_SCHEDULER_TASK_TYPE_DESC</option>
<option value="a.last_execution ASC">COM_SCHEDULER_LAST_RUN_ASC</option>
<option value="a.last_execution DESC">COM_SCHEDULER_LAST_RUN_DESC</option>
<option value="a.next_execution ASC">COM_SCHEDULER_NEXT_RUN_ASC</option>
<option value="a.next_execution DESC">COM_SCHEDULER_NEXT_RUN_DESC</option>
<option value="a.priority ASC">COM_SCHEDULER_TASK_PRIORITY_ASC</option>
<option value="a.priority DESC">COM_SCHEDULER_TASK_PRIORITY_DESC</option>
<option value="a.id ASC">JGRID_HEADING_ID_ASC</option>
Expand Down
17 changes: 14 additions & 3 deletions administrator/components/com_scheduler/src/Model/TasksModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ static function (TaskOption $taskOption): string {
$multiOrdering = $this->state->get('list.multi_ordering');

if (!$multiOrdering || !\is_array($multiOrdering)) {
$orderCol = $this->state->get('list.ordering', 'a.title');
$orderCol = $this->state->get('list.ordering', 'a.next_execution');
$orderDir = $this->state->get('list.direction', 'asc');

// Type title ordering is handled exceptionally in _getList()
Expand Down Expand Up @@ -365,7 +365,7 @@ static function (TaskOption $taskOption): string {
protected function _getList($query, $limitstart = 0, $limit = 0): array
{
// Get stuff from the model state
$listOrder = $this->getState('list.ordering', 'a.title');
$listOrder = $this->getState('list.ordering', 'a.next_execution');
$listDirectionN = strtolower($this->getState('list.direction', 'asc')) === 'desc' ? -1 : 1;

// Set limit parameters and get object list
Expand Down Expand Up @@ -432,7 +432,7 @@ private function attachTaskOptions(array $items): void
* @return void
* @since 4.1.0
*/
protected function populateState($ordering = 'a.title', $direction = 'ASC'): void
protected function populateState($ordering = 'a.next_execution', $direction = 'ASC'): void
{
// Call the parent method
parent::populateState($ordering, $direction);
Expand Down Expand Up @@ -467,4 +467,15 @@ public function hasDueTasks(Date $time): bool
// False if we don't have due tasks, or we have locked tasks
return $taskDetails && $taskDetails->due_count && !$taskDetails->locked_count;
}

/**
* Check if we have right now any enabled due tasks and no locked tasks.
*
* @return boolean
* @since 5.2.0
*/
public function getHasDueTasks()
{
return $this->hasDueTasks(Factory::getDate('now', 'UTC'));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public function display($tpl = null): void
$this->state = $this->get('State');
$this->filterForm = $this->get('FilterForm');
$this->activeFilters = $this->get('ActiveFilters');
$this->hasDueTasks = $this->get('hasDueTasks');

if (!\count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) {
$this->setLayout('empty_state');
Expand Down
16 changes: 16 additions & 0 deletions administrator/components/com_scheduler/tmpl/tasks/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
$saveOrderingUrl = 'index.php?option=com_scheduler&task=tasks.saveOrderAjax&tmpl=component&' . Session::getFormToken() . '=1';
HTMLHelper::_('draggablelist.draggable');
}

// When there are due Tasks show that information to the user
if ($this->hasDueTasks === true) {
$app->enqueueMessage(Text::_('COM_SCHEDULER_MSG_DUETASKS'), 'warning');
}

?>

<form action="<?php echo Route::_('index.php?option=com_scheduler&view=tasks'); ?>" method="post" name="adminForm"
Expand Down Expand Up @@ -129,6 +135,11 @@ class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
<?php echo HTMLHelper::_('searchtools.sort', 'COM_SCHEDULER_LAST_RUN_DATE', 'a.last_execution', $listDirn, $listOrder) ?>
</th>

<!-- Next runs -->
<th scope="col" class="d-none d-lg-table-cell">
<?php echo HTMLHelper::_('searchtools.sort', 'COM_SCHEDULER_NEXT_RUN_DATE', 'a.next_execution', $listDirn, $listOrder) ?>
</th>

<!-- Test task -->
<th scope="col" class="d-none d-md-table-cell">
<?php echo Text::_('COM_SCHEDULER_TEST_TASK'); ?>
Expand Down Expand Up @@ -239,6 +250,11 @@ class="js-draggable" data-url="<?php echo $saveOrderingUrl; ?>" data-direction="
<?php echo $item->last_execution ? HTMLHelper::_('date', $item->last_execution, 'DATE_FORMAT_LC5') : '-'; ?>
</td>

<!-- Next run date -->
<td class="small d-none d-lg-table-cell">
<?php echo $item->next_execution ? HTMLHelper::_('date', $item->next_execution, 'DATE_FORMAT_LC5') : Text::_('COM_SCHEDULER_NEXT_RUN_MANUAL'); ?>
</td>

<!-- Test task -->
<td class="small d-none d-md-table-cell">
<button type="button" class="btn btn-sm btn-warning" <?php echo $item->state < 0 ? 'disabled' : ''; ?>
Expand Down
4 changes: 3 additions & 1 deletion administrator/language/en-GB/com_joomlaupdate.ini
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ COM_JOOMLAUPDATE_SELF_EMPTYSTATE_CONTENT="You must update this component first b
COM_JOOMLAUPDATE_SELF_EMPTYSTATE_TITLE="A new version of the Joomla Update Component is available"
COM_JOOMLAUPDATE_SYSTEM_CHECK="System Check"
COM_JOOMLAUPDATE_TOOLBAR_CHECK="Check for Updates"
COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_FAILED="Failed to reset the update channel from \"%1$s\" to \"%2$s\". Please change it in the Joomla Update Component's options so you don't miss future updates."
COM_JOOMLAUPDATE_UPDATE_CHANGE_UPDATE_SOURCE_OK="The update channel has been reset from \"%1$s\" to \"%2$s\"."
COM_JOOMLAUPDATE_UPDATE_CHECK="Update Check"
COM_JOOMLAUPDATE_UPDATE_CONFIRM_BACKUP="I'm aware that a backup before any update is highly recommended."
COM_JOOMLAUPDATE_UPDATE_EMPTYSTATE_TITLE="Update your site to \"Joomla! %s\""
Expand Down Expand Up @@ -169,7 +171,7 @@ COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATE_NOTICE="Before you update Joomla, ensure th
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATEFOUND="A Joomla update was found."
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_CUSTOM="You are on the &quot;%s&quot; update channel. This is not an official Joomla update channel."
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_DEFAULT="You are on the &quot;%s&quot; update channel. Through this channel you'll receive notifications for all updates of the current Joomla release (5.x)"
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_NEXT="You are on the &quot;%s&quot; update channel. Through this channel you'll receive notifications for all updates of the current Joomla release (5.x) and you will also be notified when the future major release (6.x) will be available. Before upgrading to 6.x you'll need to assess its compatibility with your environment."
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_NEXT="You are on the &quot;%s&quot; update channel. Through this channel you will be notified when the future major release (6.x) will be available. Before upgrading to 6.x you'll need to assess its compatibility with your environment. You will not be notified about updates of the current Joomla release (5.x)."
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_TESTING="You are on the &quot;%s&quot; update channel. This channel is designed for testing new releases and fixes in Joomla.<br>It is only intended for JBS (Joomla Bug Squad&trade;) members and others within the Joomla community who are testing. Do not use this setting on a production site."
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPLOAD_INTRO="You can use this feature to update Joomla if your server is behind a firewall or otherwise unable to contact the update servers. First download the Joomla <em><strong>Update Package</strong></em> in ZIP format from <a class='alert-link' href='%s' target='_blank' rel='noopener noreferrer'>the official Joomla download page</a>. Then use the fields below to upload and install it."
COM_JOOMLAUPDATE_VIEW_UPDATE_BYTESEXTRACTED="Bytes extracted"
Expand Down
5 changes: 5 additions & 0 deletions administrator/language/en-GB/com_scheduler.ini
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@ COM_SCHEDULER_MANAGER_TASKS="Scheduled Tasks"
COM_SCHEDULER_MANAGER_TASK_EDIT="Edit Task"
COM_SCHEDULER_MANAGER_TASK_NEW="New Task"
COM_SCHEDULER_MANAGER_TOOLTIP_TASK_FAILING="Task failed. Exit code: %1$d"
COM_SCHEDULER_MSG_DUETASKS="There is at least one due task which should have already run. Please make sure that at least one cron scheduler is enabled and running."
COM_SCHEDULER_MSG_MANAGE_NO_TASK_PLUGINS="There are no task types matching your query."
COM_SCHEDULER_NEW_TASK="New Task"
COM_SCHEDULER_NEXT_RUN_ASC="Next Run ascending"
COM_SCHEDULER_NEXT_RUN_DATE="Next Run Date"
COM_SCHEDULER_NEXT_RUN_DESC="Next Run descending"
COM_SCHEDULER_NEXT_RUN_MANUAL="Manual"
COM_SCHEDULER_N_ITEMS_CHECKED_IN_1="Task checked in."
COM_SCHEDULER_N_ITEMS_CHECKED_IN_MORE="%d tasks checked in."
COM_SCHEDULER_N_ITEMS_DELETED="%d tasks deleted."
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<name>English (en-GB)</name>
<tag>en-GB</tag>
<version>5.2.0</version>
<creationDate>2024-06</creationDate>
<creationDate>2024-07</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/langmetadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<metafile client="administrator">
<name>English (en-GB)</name>
<version>5.2.0</version>
<creationDate>2024-06</creationDate>
<creationDate>2024-07</creationDate>
<author>Joomla! Project</author>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
Expand Down
2 changes: 2 additions & 0 deletions administrator/language/en-GB/plg_editors_tinymce.ini
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,6 @@ PLG_TINY_TOOLBAR_BUTTON_FONTSIZESELECT="Font Size Select"
PLG_TINY_TOOLBAR_BUTTON_FORMATSELECT="Format Select"
PLG_TINY_TOOLBAR_BUTTON_SEPARATOR="Separator"
PLG_TINY_TOOLBAR_BUTTON_STYLESELECT="Style Select"
PLG_TINY_FIELD_SANDBOX_IFRAMES_LABEL="Sandbox Iframes"
PLG_TINY_FIELD_SANDBOX_IFRAMES_DESC="This is a security feature that restricts what the iframe can do by setting a sandbox attribute for each iframe. It is recommended to enable this feature for security reasons. Only disable if the iframe is not loading and you're sure that the iframed content is safe."
PLG_TINY_XML_DESCRIPTION="TinyMCE is a platform independent web based JavaScript HTML WYSIWYG Editor. Using <strong>sets</strong> you can configure and customise the editor for every user group."
Loading

0 comments on commit 3223f82

Please sign in to comment.