Skip to content

Commit

Permalink
Merge pull request joomla#41708 from Digital-Peak/upmerge
Browse files Browse the repository at this point in the history
[5.0] Upmerge
  • Loading branch information
HLeithner authored Sep 12, 2023
2 parents 380ded8 + 7c21bc2 commit f69d4a9
Show file tree
Hide file tree
Showing 46 changed files with 877 additions and 267 deletions.
4 changes: 2 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ steps:
- ./libraries/vendor/bin/phan

- name: npm
image: node:16-bullseye-slim
image: node:18-bullseye-slim
depends_on: [ phpcs ]
volumes:
- name: npm-cache
Expand Down Expand Up @@ -372,6 +372,6 @@ trigger:

---
kind: signature
hmac: 6b06b1c7f407650fe98f0851dc865911f399422116fa4f250a52d01a556397ed
hmac: 45b19b7430edc5ec922ef32c2f2dcb284c7cbf7ba55eb295ba4d877cee0fe5a4

...
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ public function purge()
$this->checkToken();

// Remove the script time limit.
@set_time_limit(0);
if (\function_exists('set_time_limit')) {
set_time_limit(0);
}

/** @var \Joomla\Component\Finder\Administrator\Model\IndexModel $model */
$model = $this->getModel('Index', 'Administrator');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ public function batch()
ob_start();

// Remove the script time limit.
@set_time_limit(0);
if (\function_exists('set_time_limit')) {
set_time_limit(0);
}

// Get the indexer state.
$state = Indexer::getState();
Expand Down
35 changes: 33 additions & 2 deletions administrator/components/com_scheduler/src/Model/TasksModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace Joomla\Component\Scheduler\Administrator\Model;

use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Date\Date;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
Expand Down Expand Up @@ -366,7 +367,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0): array
{
// Get stuff from the model state
$listOrder = $this->getState('list.ordering', 'a.title');
$listDirectionN = strtolower($this->getState('list.direction', 'asc')) == 'desc' ? -1 : 1;
$listDirectionN = strtolower($this->getState('list.direction', 'asc')) === 'desc' ? -1 : 1;

// Set limit parameters and get object list
$query->setLimit($limit, $limitstart);
Expand Down Expand Up @@ -395,7 +396,7 @@ static function (array $arr) {
$this->attachTaskOptions($responseList);

// If ordering by non-db fields, we need to sort here in code
if ($listOrder == 'j.type_title') {
if ($listOrder === 'j.type_title') {
$responseList = ArrayHelper::sortObjects($responseList, 'safeTypeTitle', $listDirectionN, true, false);
}

Expand Down Expand Up @@ -437,4 +438,34 @@ protected function populateState($ordering = 'a.title', $direction = 'ASC'): voi
// Call the parent method
parent::populateState($ordering, $direction);
}

/**
* Check if we have any enabled due tasks and no locked tasks.
*
* @param Date $time The next execution time to check against
*
* @return boolean
* @since __DEPLOY_VERSION__
*/
public function hasDueTasks(Date $time): bool
{
$db = $this->getDatabase();
$now = $time->toSql();

$query = $db->getQuery(true)
// Count due tasks
->select('SUM(CASE WHEN ' . $db->quoteName('a.next_execution') . ' <= :now THEN 1 ELSE 0 END) AS due_count')
// Count locked tasks
->select('SUM(CASE WHEN ' . $db->quoteName('a.locked') . ' IS NULL THEN 0 ELSE 1 END) AS locked_count')
->from($db->quoteName('#__scheduler_tasks', 'a'))
->where($db->quoteName('a.state') . ' = 1')
->bind(':now', $now);

$db->setQuery($query);

$taskDetails = $db->loadObject();

// False if we don't have due tasks, or we have locked tasks
return $taskDetails && $taskDetails->due_count && !$taskDetails->locked_count;
}
}
1 change: 0 additions & 1 deletion administrator/components/com_users/forms/group.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
name="id"
type="hidden"
default="0"
required="true"
readonly="true"
/>

Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/com_actionlogs.sys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
COM_ACTIONLOGS="User Actions Log"
COM_ACTIONLOGS_VIEW_DEFAULT_DESC="Shows a list of user actions."
COM_ACTIONLOGS_VIEW_DEFAULT_TITLE="User Action Log"
COM_ACTIONLOGS_XML_DESCRIPTION="Displays a log of actions performed by users on your website."
COM_ACTIONLOGS_XML_DESCRIPTION="Displays a log of actions performed by users on your website."
2 changes: 1 addition & 1 deletion administrator/language/en-GB/com_associations.sys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
; Note : All ini files need to be saved as UTF-8

COM_ASSOCIATIONS="Multilingual Associations"
COM_ASSOCIATIONS_XML_DESCRIPTION="Improved multilingual content management component"
COM_ASSOCIATIONS_XML_DESCRIPTION="Improved multilingual content management component"
2 changes: 1 addition & 1 deletion administrator/language/en-GB/plg_content_joomla.sys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
; Note : All ini files need to be saved as UTF-8

PLG_CONTENT_JOOMLA="Content - Joomla"
PLG_CONTENT_JOOMLA_XML_DESCRIPTION="This plugin does category processing for core extensions; sends an email when new article is submitted in the Frontend."
PLG_CONTENT_JOOMLA_XML_DESCRIPTION="This plugin does category processing for core extensions; sends an email when new article is submitted in the Frontend."
2 changes: 1 addition & 1 deletion administrator/language/en-GB/plg_content_vote.sys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
; Note : All ini files need to be saved as UTF-8

PLG_CONTENT_VOTE="Content - Vote"
PLG_VOTE_XML_DESCRIPTION="Add Voting functionality to Articles."
PLG_VOTE_XML_DESCRIPTION="Add Voting functionality to Articles."
2 changes: 1 addition & 1 deletion administrator/language/en-GB/plg_extension_joomla.sys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
; Note : All ini files need to be saved as UTF-8

PLG_EXTENSION_JOOMLA="Extension - Joomla"
PLG_EXTENSION_JOOMLA_XML_DESCRIPTION="Manage the update sites for extensions."
PLG_EXTENSION_JOOMLA_XML_DESCRIPTION="Manage the update sites for extensions."
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
; Note : All ini files need to be saved as UTF-8

PLG_EXTENSION_NAMESPACEMAP="Extension - Namespace Updater"
PLG_EXTENSION_NAMESPACEMAP_XML_DESCRIPTION="<p>Automatically builds and updates the <strong>administrator/cache/autoload_psr4.php</strong> file that is used to autoload extensions.</p><p><strong>Warning! This plugin must be enabled</strong> as it runs on extension install, update and uninstall.</p>"
PLG_EXTENSION_NAMESPACEMAP_XML_DESCRIPTION="<p>Automatically builds and updates the <strong>administrator/cache/autoload_psr4.php</strong> file that is used to autoload extensions.</p><p><strong>Warning! This plugin must be enabled</strong> as it runs on extension install, update and uninstall.</p>"
2 changes: 1 addition & 1 deletion administrator/language/en-GB/plg_system_sef.sys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
; Note : All ini files need to be saved as UTF-8

PLG_SEF_XML_DESCRIPTION="Adds SEF support to links in the document. It operates directly on the HTML and does not require a special tag."
PLG_SYSTEM_SEF="System - SEF"
PLG_SYSTEM_SEF="System - SEF"
2 changes: 1 addition & 1 deletion administrator/language/en-GB/plg_user_terms.sys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
; Note : All ini files need to be saved as UTF-8

PLG_USER_TERMS="User - Terms and Conditions"
PLG_USER_TERMS_XML_DESCRIPTION="Basic plugin to request user's consent to the site's terms and conditions."
PLG_USER_TERMS_XML_DESCRIPTION="Basic plugin to request user's consent to the site's terms and conditions."
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ModulesController extends ApiController
*/
public function displayItem($id = null)
{
$this->modelState->set('filter.client_id', $this->getClientIdFromInput());
$this->modelState->set('client_id', $this->getClientIdFromInput());

return parent::displayItem($id);
}
Expand All @@ -67,7 +67,7 @@ public function displayItem($id = null)
*/
public function displayList()
{
$this->modelState->set('filter.client_id', $this->getClientIdFromInput());
$this->modelState->set('client_id', $this->getClientIdFromInput());

return parent::displayList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected function preprocessSaveData(array $data): array
// If we are updating an item the template is a readonly property based on the ID
if ($this->input->getMethod() === 'PATCH') {
if (\array_key_exists('template', $data)) {
throw new InvalidParameterException('The template property cannot be modified for an existing style');
unset($data['template']);
}

$model = $this->getModel(Inflector::singularize($this->contentType), '', ['ignore_request' => true]);
Expand Down
11 changes: 11 additions & 0 deletions build/bump.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ function usage($command)

$antJobFile = '/build.xml';

$packageJsonFile = '/package.json';

$readMeFiles = [
'/README.md',
'/README.txt',
Expand Down Expand Up @@ -245,6 +247,15 @@ function usage($command)
file_put_contents($rootPath . $antJobFile, $fileContents);
}

// Updates the version in the package.json file.
if (file_exists($rootPath . $packageJsonFile)) {
$package = json_decode(file_get_contents($rootPath . $packageJsonFile));
$package->version = $version['release'];

// @todo use a native formatter whenever https://github.com/php/php-src/issues/8864 is resolved
file_put_contents($rootPath . $packageJsonFile, str_replace(' ', ' ', json_encode($package, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)));
}

// Updates the version in readme files.
foreach ($readMeFiles as $readMeFile) {
if (file_exists($rootPath . $readMeFile)) {
Expand Down
67 changes: 59 additions & 8 deletions build/media_source/system/css/fields/calendar-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
* @copyright (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
.js-calendar {

.js-calendar {
box-shadow: 0 0 15px 4px rgba(0,0,0,.15) !important;
}
}

.calendar-container {
float: left;
min-width: 160px;
Expand All @@ -14,13 +16,23 @@
background-color: #ffffff !important;
z-index: 1100 !important;
}

.calendar-container .nav {
display: table-cell;
}

.calendar-container table {
table-layout: fixed;
max-width: 262px;
max-width: 268px;
border-radius: 5px;
background-color: #ffffff !important;
z-index: 1100 !important;
margin-top: 2px;
margin-left: auto;
margin-right: auto;
padding: 3px;
}

/* The main calendar widget. DIV containing a table. */
div.calendar-container table th, .calendar-container table td {
box-shadow: none;
Expand Down Expand Up @@ -100,6 +112,7 @@ div.calendar-container table td.title { /* This holds the current "month, year"
width: auto;
font-weight: bold;
}

.calendar-container table tbody td.today:after {
position: absolute;
bottom: 3px;
Expand All @@ -110,6 +123,7 @@ div.calendar-container table td.title { /* This holds the current "month, year"
border-radius: 1.5px;
background-color: #46a546;
}

.calendar-container table tbody td.today.selected:after {
background-color: #fff;
}
Expand All @@ -119,6 +133,7 @@ div.calendar-container table td.title { /* This holds the current "month, year"
background: #3d8fd7;
color: #fff;
}

.calendar-container table tbody td.day:hover:after {
background-color: #fff;
}
Expand All @@ -135,42 +150,78 @@ div.calendar-container table td.title { /* This holds the current "month, year"
.calendar-container table tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
display: none;
}

.calendar-container .calendar-head-row td {
padding: 4px 0 !important;
border-bottom: none;
}

.calendar-container .day-name {
padding-top: 0.5rem;
font-size: 0.7rem;
font-weight: bold;
border-bottom: none;
}

.calendar-container .time td {
padding: 8px 8px 8px 0;
padding: 15px 3px 10px 0;
border-bottom: none;
}

.calendar-container td.time-title {
display: block;
margin-top: 20px;
}

.calendar-container .time td select {
display: block;
width: 100%;
padding: 5px 9px 3px;
font-size: 16px;
font-weight: 400;
line-height: 1.5;
color: #212529;
background-color: #f0f4fb;
background-image: url("../../images/select-bg-rtl.svg");
background-repeat: no-repeat;
background-position: left center;
background-size: max(100%, 58rem);
border: 1px solid #cdcdcd;
border-radius: 0.25rem;
appearance: none;
}

.buttons-wrapper {
padding: 5px 5px;
width:100%;
margin-bottom: 0 !important;
padding: 5px;
width: 100%;
}

.buttons-wrapper .btn {
min-width: 60px;
color: #495057;
border: 1px solid #495057;
margin-left: .5rem;
margin-left: 0;
padding: 0 16px;
line-height: 2.375rem;
box-shadow: 1px 0 1px 1px rgba(0,0,0,.25);
}

.buttons-wrapper .btn:hover {
color: #fff;
background: #1a466b;
}

.buttons-wrapper .btn:last-child {
margin-left: 0;
}

.time .time-title {
background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg width='22' height='22' viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1024 544v448q0 14-9 23t-23 9h-320q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h224v-352q0-14 9-23t23-9h64q14 0 23 9t9 23zm416 352q0-148-73-273t-198-198-273-73-273 73-198 198-73 273 73 273 198 198 273 73 273-73 198-198 73-273zm224 0q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z'/%3E%3C/svg%3E");
background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg width='24' height='24' viewBox='0 0 1792 1792' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1024 544v448q0 14-9 23t-23 9h-320q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h224v-352q0-14 9-23t23-9h64q14 0 23 9t9 23zm416 352q0-148-73-273t-198-198-273-73-273 73-198 198-73 273 73 273 198 198 273 73 273-73 198-198 73-273zm224 0q0 209-103 385.5t-279.5 279.5-385.5 103-385.5-103-279.5-279.5-103-385.5 103-385.5 279.5-279.5 385.5-103 385.5 103 279.5 279.5 103 385.5z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: center;
}

/* Fix cursor on js-btn and time select */
.calendar-container select,
.calendar-container .js-btn {
Expand Down
Loading

0 comments on commit f69d4a9

Please sign in to comment.