Skip to content

Commit 4da7f67

Browse files
Pytalbackportbot[bot]
authored andcommitted
refactor: Inject IRootFolder
Signed-off-by: Christopher Ng <chrng8@gmail.com> [skip ci]
1 parent b38f819 commit 4da7f67

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

apps/files/lib/Service/OwnershipTransferService.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ public function transfer(
109109
// a lazy root folder which does not create the destination users folder
110110
\OC_Util::setupFS($sourceUser->getUID());
111111
\OC_Util::setupFS($destinationUser->getUID());
112-
\OC::$server->getUserFolder($sourceUser->getUID());
113-
\OC::$server->getUserFolder($destinationUser->getUID());
112+
$this->rootFolder->getUserFolder($sourceUser->getUID());
113+
$this->rootFolder->getUserFolder($destinationUser->getUID());
114114
Filesystem::initMountPoints($sourceUid);
115115
Filesystem::initMountPoints($destinationUid);
116116

@@ -477,7 +477,7 @@ private function restoreShares(
477477
} catch (\OCP\Files\NotFoundException) {
478478
// ID has changed due to transfer between different storages
479479
// Try to get the new ID from the target path and suffix of the share
480-
$node = $rootFolder->get(Filesystem::normalizePath($targetLocation . '/' . $suffix));
480+
$node = $this->rootFolder->get(Filesystem::normalizePath($targetLocation . '/' . $suffix));
481481
$newNodeId = $node->getId();
482482
$output->writeln('Had to change node id to ' . $newNodeId, OutputInterface::VERBOSITY_VERY_VERBOSE);
483483
}

0 commit comments

Comments
 (0)