diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-03-07 14:24:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-07 14:24:48 +0300 |
commit | 4ee10c85ddf36faa12d324cc6d6f4b0503a1a8ca (patch) | |
tree | 931045871972039b1ca3504cad88b2dbc2fb363e | |
parent | 9ffbbd64129302318d71700bfeaac5f27a671cd6 (diff) | |
parent | 034a6e9c900881ca5643d79f1ed1e9d0bd7f0449 (diff) |
Merge pull request #31446 from nextcloud/backport/30953/stable22
[stable22] Init user's file system if not existing on ownership transfer
-rw-r--r-- | apps/files/lib/Service/OwnershipTransferService.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/apps/files/lib/Service/OwnershipTransferService.php b/apps/files/lib/Service/OwnershipTransferService.php index 670e6419d75..661a7e66e10 100644 --- a/apps/files/lib/Service/OwnershipTransferService.php +++ b/apps/files/lib/Service/OwnershipTransferService.php @@ -144,13 +144,12 @@ class OwnershipTransferService { throw new TransferOwnershipException("Unknown path provided: $path", 1); } - if ($move && ( - !$view->is_dir($finalTarget) || ( - !$firstLogin && - count($view->getDirectoryContent($finalTarget)) > 0 - ) - ) - ) { + if ($move && !$view->is_dir($finalTarget)) { + // Initialize storage + \OC_Util::setupFS($destinationUser->getUID()); + } + + if ($move && !$firstLogin && count($view->getDirectoryContent($finalTarget)) > 0) { throw new TransferOwnershipException("Destination path does not exists or is not empty", 1); } |