Skip to content

Commit ff0ccc8

Browse files
authored
Merge pull request #31934 from nextcloud/getbyid-setup-fallback
perform a setup if we can't find any mounts containing a file
2 parents 483741f + b65d214 commit ff0ccc8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/private/Files/Node/Root.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,12 @@ public function getByIdInPath(int $id, string $path): array {
419419
}
420420
$mountsContainingFile = $mountCache->getMountsForFileId($id, $user);
421421

422+
// if the mount isn't in the cache yet, perform a setup first, then try again
423+
if (count($mountsContainingFile) === 0) {
424+
$this->mountManager->getSetupManager()->setupForPath($path, true);
425+
$mountsContainingFile = $mountCache->getMountsForFileId($id, $user);
426+
}
427+
422428
// when a user has access trough the same storage trough multiple paths
423429
// (such as an external storage that is both mounted for a user and shared to the user)
424430
// the mount cache will only hold a single entry for the storage

0 commit comments

Comments
 (0)