mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(Manager#fillInputs): Try to setup user FS before access file inputs
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
parent
a9a2cbf8bb
commit
c1f84aaad1
1 changed files with 4 additions and 4 deletions
|
|
@ -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<array-key, list<numeric|string>|numeric|string> $input
|
||||
* @param ShapeDescriptor[] ...$specs the specs
|
||||
* @return array<array-key, list<File|numeric|string>|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');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue