From c1f84aaad11e47edd3e1af518b30095259736ba0 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Mon, 13 May 2024 09:04:56 +0200 Subject: [PATCH] fix(Manager#fillInputs): Try to setup user FS before access file inputs Signed-off-by: Marcel Klehr --- lib/private/TaskProcessing/Manager.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/private/TaskProcessing/Manager.php b/lib/private/TaskProcessing/Manager.php index 97cb39ae7c8..956f708f09a 100644 --- a/lib/private/TaskProcessing/Manager.php +++ b/lib/private/TaskProcessing/Manager.php @@ -741,6 +741,7 @@ class Manager implements IManager { /** * Takes task input or output data and replaces fileIds with base64 data * + * @param string|null $userId * @param array|numeric|string> $input * @param ShapeDescriptor[] ...$specs the specs * @return array|numeric|string|File> @@ -751,8 +752,7 @@ class Manager implements IManager { */ public function fillInputFileData(?string $userId, array $input, ...$specs): array { if ($userId !== null) { - // load user folder for later - $this->rootFolder->getUserFolder($userId); + \OC_Util::setupFS($userId); } $newInputOutput = []; $spec = array_reduce($specs, fn ($carry, $spec) => $carry + $spec, []); @@ -780,9 +780,9 @@ class Manager implements IManager { } else { $newInputOutput[$key] = []; foreach ($input[$key] as $item) { - $node = $this->rootFolder->getFirstNodeById((int)$input[$key]); + $node = $this->rootFolder->getFirstNodeById((int)$item); if ($node === null) { - $node = $this->rootFolder->getFirstNodeByIdInPath((int)$input[$key], '/' . $this->rootFolder->getAppDataDirectoryName() . '/'); + $node = $this->rootFolder->getFirstNodeByIdInPath((int)$item, '/' . $this->rootFolder->getAppDataDirectoryName() . '/'); if (!$node instanceof File) { throw new ValidationException('File id given for key "' . $key . '" is not a file'); }