From 6a2f2a12398f100506d0e88fe0ef02036bd8f5da Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 17 Aug 2022 14:14:05 +0200 Subject: [PATCH] Use LazyUser when creating the user folder Signed-off-by: Joas Schilling --- lib/private/Files/Node/Root.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/Node/Root.php b/lib/private/Files/Node/Root.php index 29cdbb987c350..194fdd541d8e2 100644 --- a/lib/private/Files/Node/Root.php +++ b/lib/private/Files/Node/Root.php @@ -32,6 +32,7 @@ namespace OC\Files\Node; +use OC\User\LazyUser; use OCP\Cache\CappedMemoryCache; use OC\Files\FileInfo; use OC\Files\Mount\Manager; @@ -362,7 +363,7 @@ public function getName() { * @throws NotPermittedException */ public function getUserFolder($userId) { - $userObject = $this->userManager->get($userId); + $userObject = new LazyUser($userId, $this->userManager); if (is_null($userObject)) { $e = new NoUserException('Backends provided no user object'); @@ -477,7 +478,7 @@ public function getByIdInPath(int $id, string $path): array { $absolutePath = rtrim($mount->getMountPoint() . $pathRelativeToMount, '/'); return $this->createNode($absolutePath, new FileInfo( $absolutePath, $mount->getStorage(), $cacheEntry->getPath(), $cacheEntry, $mount, - \OC::$server->getUserManager()->get($mount->getStorage()->getOwner($pathRelativeToMount)) + new LazyUser($mount->getStorage()->getOwner($pathRelativeToMount), $this->userManager) )); }, $mountsContainingFile);