Skip to content

Commit e60fc89

Browse files
committed
Joomla! 5.2.4
1 parent b5104a9 commit e60fc89

File tree

3 files changed

+58
-7
lines changed

3 files changed

+58
-7
lines changed

administrator/components/com_scheduler/src/Model/TasksModel.php

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
*/
3636
class TasksModel extends ListModel
3737
{
38+
protected $listForbiddenList = ['select', 'multi_ordering'];
39+
3840
/**
3941
* Constructor.
4042
*
@@ -343,8 +345,19 @@ static function (TaskOption $taskOption): string {
343345
}
344346
}
345347
} else {
346-
// @todo Should add quoting here
347-
$query->order($multiOrdering);
348+
$orderClauses = [];
349+
350+
// Loop through provided clauses
351+
foreach ($multiOrdering as $ordering) {
352+
[$column, $direction] = explode(' ', $ordering);
353+
354+
$orderClauses[] = $db->quoteName($column) . ' ' . $direction;
355+
}
356+
357+
// At least one correct order clause
358+
if (\count($orderClauses) > 0) {
359+
$query->order($orderClauses);
360+
}
348361
}
349362

350363
return $query;
@@ -435,6 +448,44 @@ private function attachTaskOptions(array $items): void
435448
*/
436449
protected function populateState($ordering = 'a.next_execution', $direction = 'ASC'): void
437450
{
451+
$app = Factory::getApplication();
452+
453+
// Clean the multiorder values
454+
if ($list = $app->getUserStateFromRequest($this->context . '.list', 'list', [], 'array')) {
455+
if (!empty($list['multi_ordering']) && \is_array($list['multi_ordering'])) {
456+
$orderClauses = [];
457+
458+
// Loop through provided clauses
459+
foreach ($list['multi_ordering'] as $multiOrdering) {
460+
// Split the combined string into individual variables
461+
$multiOrderingParts = explode(' ', $multiOrdering, 2);
462+
463+
// Check that at least the column is present
464+
if (\count($multiOrderingParts) < 1) {
465+
continue;
466+
}
467+
468+
// Assign variables
469+
$multiOrderingColumn = $multiOrderingParts[0];
470+
$multiOrderingDir = \count($multiOrderingParts) === 2 ? $multiOrderingParts[1] : 'asc';
471+
472+
// Validate provided column
473+
if (!\in_array($multiOrderingColumn, $this->filter_fields)) {
474+
continue;
475+
}
476+
477+
// Validate order dir
478+
if (strtolower($multiOrderingDir) !== 'asc' && strtolower($multiOrderingDir) !== 'desc') {
479+
continue;
480+
}
481+
482+
$orderClauses[] = $multiOrderingColumn . ' ' . $multiOrderingDir;
483+
}
484+
485+
$this->setState('list.multi_ordering', $orderClauses);
486+
}
487+
}
488+
438489
// Call the parent method
439490
parent::populateState($ordering, $direction);
440491
}

administrator/manifests/files/joomla.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<authorUrl>www.joomla.org</authorUrl>
77
<copyright>(C) 2019 Open Source Matters, Inc.</copyright>
88
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
9-
<version>5.2.4-dev</version>
9+
<version>5.2.4</version>
1010
<creationDate>2025-02</creationDate>
1111
<description>FILES_JOOMLA_XML_DESCRIPTION</description>
1212

libraries/src/Version.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ final class Version
6666
* @var string
6767
* @since 3.8.0
6868
*/
69-
public const EXTRA_VERSION = 'dev';
69+
public const EXTRA_VERSION = '';
7070

7171
/**
7272
* Development status.
7373
*
7474
* @var string
7575
* @since 3.5
7676
*/
77-
public const DEV_STATUS = 'Development';
77+
public const DEV_STATUS = 'Stable';
7878

7979
/**
8080
* Code name.
@@ -90,15 +90,15 @@ final class Version
9090
* @var string
9191
* @since 3.5
9292
*/
93-
public const RELDATE = '11-February-2025';
93+
public const RELDATE = '18-February-2025';
9494

9595
/**
9696
* Release time.
9797
*
9898
* @var string
9999
* @since 3.5
100100
*/
101-
public const RELTIME = '16:01';
101+
public const RELTIME = '16:00';
102102

103103
/**
104104
* Release timezone.

0 commit comments

Comments
 (0)