diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-10-29 11:33:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-29 11:33:42 +0100 |
commit | a9dd34ab35d9bf160a6d9d98de50192b342fa16b (patch) | |
tree | a1124000c6abec74ca6e3a35c3a2b8a8749c6e06 /apps | |
parent | 7bd791f327d75d26862d67e07c4eb87d453b11d6 (diff) | |
parent | 6090985ca3b21bfc6096aaeb943e4a75bc919b83 (diff) | |
download | nextcloud-server-a9dd34ab35d9bf160a6d9d98de50192b342fa16b.tar.gz nextcloud-server-a9dd34ab35d9bf160a6d9d98de50192b342fa16b.zip |
Merge pull request #48746 from nextcloud/backport/46124/stable30
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/lib/Service/OwnershipTransferService.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php index 71c3731b66b..f324d1e449a 100644 --- a/apps/files/lib/Service/OwnershipTransferService.php +++ b/apps/files/lib/Service/OwnershipTransferService.php @@ -47,6 +47,7 @@ class OwnershipTransferService { private IUserMountCache $userMountCache, private IUserManager $userManager, private IFactory $l10nFactory, + private IRootFolder $rootFolder, ) { $this->encryptionManager = $encryptionManager; } @@ -85,8 +86,10 @@ class OwnershipTransferService { // Requesting the user folder will set it up if the user hasn't logged in before // We need a setupFS for the full filesystem setup before as otherwise we will just return // a lazy root folder which does not create the destination users folder + \OC_Util::setupFS($sourceUser->getUID()); \OC_Util::setupFS($destinationUser->getUID()); - \OC::$server->getUserFolder($destinationUser->getUID()); + $this->rootFolder->getUserFolder($sourceUser->getUID()); + $this->rootFolder->getUserFolder($destinationUser->getUID()); Filesystem::initMountPoints($sourceUid); Filesystem::initMountPoints($destinationUid); @@ -416,7 +419,6 @@ class OwnershipTransferService { ):void { $output->writeln("Restoring shares ..."); $progress = new ProgressBar($output, count($shares)); - $rootFolder = \OCP\Server::get(IRootFolder::class); foreach ($shares as ['share' => $share, 'suffix' => $suffix]) { try { @@ -455,7 +457,7 @@ class OwnershipTransferService { } catch (\OCP\Files\NotFoundException) { // ID has changed due to transfer between different storages // Try to get the new ID from the target path and suffix of the share - $node = $rootFolder->get(Filesystem::normalizePath($targetLocation . '/' . $suffix)); + $node = $this->rootFolder->get(Filesystem::normalizePath($targetLocation . '/' . $suffix)); $newNodeId = $node->getId(); } $share->setNodeId($newNodeId); |