Skip to content

Commit ef6e974

Browse files
authored
Merge pull request #55573 from nextcloud/fix/taskprocessing/list-command
fix(TaskProcessing): Make sure list command int filter parameters are parsed as ints
2 parents e67fe86 + f28344e commit ef6e974

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/Command/TaskProcessing/ListCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected function configure() {
5454
'status',
5555
's',
5656
InputOption::VALUE_OPTIONAL,
57-
'only get the tasks that have a specific status (STATUS_UNKNOWN=0, STATUS_SCHEDULED=1, STATUS_RUNNING=2, STATUS_SUCCESSFUL=3, STATUS_FAILED=4, STATUS_CANCELLED=5)'
57+
'only get the tasks that have a specific status (STATUS_UNKNOWN=0, STATUS_SCHEDULED=1, STATUS_RUNNING=2, STATUS_SUCCESSFUL=3, STATUS_FAILED=4, STATUS_CANCELLED=5)',
5858
)
5959
->addOption(
6060
'scheduledAfter',
@@ -81,9 +81,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8181
$type = $input->getOption('type');
8282
$appId = $input->getOption('appId');
8383
$customId = $input->getOption('customId');
84-
$status = $input->getOption('status');
85-
$scheduledAfter = $input->getOption('scheduledAfter');
86-
$endedBefore = $input->getOption('endedBefore');
84+
$status = $input->getOption('status') !== null ? (int)$input->getOption('status') : null;
85+
$scheduledAfter = $input->getOption('scheduledAfter') != null ? (int)$input->getOption('scheduledAfter') : null;
86+
$endedBefore = $input->getOption('endedBefore') !== null ? (int)$input->getOption('endedBefore') : null;
8787

8888
$tasks = $this->taskProcessingManager->getTasks($userIdFilter, $type, $appId, $customId, $status, $scheduledAfter, $endedBefore);
8989
$arrayTasks = array_map(static function (Task $task) {

0 commit comments

Comments
 (0)