aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2024-07-09 13:35:46 +0200
committerMarcel Klehr <mklehr@gmx.net>2024-07-17 13:55:55 +0200
commitee7502ab1c126d4bf744bea816c602ef3a458e35 (patch)
treee6cd0655f21721439adf5f8f57d6154e81c95c28 /lib
parentc1f2c76f447b91d4c7de43177f25e594d14bace1 (diff)
downloadnextcloud-server-ee7502ab1c126d4bf744bea816c602ef3a458e35.tar.gz
nextcloud-server-ee7502ab1c126d4bf744bea816c602ef3a458e35.zip
fix(TaskProcessing\Manager#setTaskResult): Replace files contents with ID instead of File object
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/TaskProcessing/Manager.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php
index c5ddbb31dc3..f2b4cecd99c 100644
--- a/lib/private/TaskProcessing/Manager.php
+++ b/lib/private/TaskProcessing/Manager.php
@@ -689,6 +689,15 @@ class Manager implements IManager {
} else {
$this->validateOutputFileIds($output, $outputShape, $optionalOutputShape);
}
+ // Turn file objects into IDs
+ foreach ($output as $key => $value) {
+ if ($value instanceof Node) {
+ $output[$key] = $value->getId();
+ }
+ if (is_array($value) && $value[0] instanceof Node) {
+ $output[$key] = array_map(fn($node) => $node->getId(), $value);
+ }
+ }
$task->setOutput($output);
$task->setProgress(1);
$task->setStatus(Task::STATUS_SUCCESSFUL);