]> source.dussan.org Git - nextcloud-server.git/commitdiff
perform a setup if we can't find any mounts containing a file 31934/head
authorRobin Appelman <robin@icewind.nl>
Mon, 11 Apr 2022 17:15:58 +0000 (19:15 +0200)
committerRobin Appelman <robin@icewind.nl>
Mon, 11 Apr 2022 17:15:58 +0000 (19:15 +0200)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Files/Node/Root.php

index 7592d4caf37d15140213faf55a714a3113334daa..8b599ddfd758feac504ff0d35db635edbb5de07f 100644 (file)
@@ -419,6 +419,12 @@ class Root extends Folder implements IRootFolder {
                }
                $mountsContainingFile = $mountCache->getMountsForFileId($id, $user);
 
+               // if the mount isn't in the cache yet, perform a setup first, then try again
+               if (count($mountsContainingFile) === 0) {
+                       $this->mountManager->getSetupManager()->setupForPath($path, true);
+                       $mountsContainingFile = $mountCache->getMountsForFileId($id, $user);
+               }
+
                // when a user has access trough the same storage trough multiple paths
                // (such as an external storage that is both mounted for a user and shared to the user)
                // the mount cache will only hold a single entry for the storage