Skip to content

Commit

Permalink
fix user folder init
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 committed Apr 26, 2022
1 parent 34426c8 commit 625ed52
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 7 additions & 3 deletions lib/private/Files/ObjectStore/ObjectStoreStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,13 @@ public function __construct($params) {
if (isset($params['objectPrefix'])) {
$this->objectPrefix = $params['objectPrefix'];
}
//initialize cache with root directory in cache
if (!$this->is_dir('/')) {
$this->mkdir('/');

// home storage is setup in the SetupManager
if (!$this instanceof HomeObjectStoreStorage) {
//initialize cache with root directory in cache
if (!$this->is_dir('/')) {
$this->mkdir('/');
}
}

$this->logger = \OC::$server->getLogger();
Expand Down
6 changes: 4 additions & 2 deletions lib/private/Files/SetupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,10 @@ private function oneTimeUserSetup(IUser $user) {
$this->mountManager->addMount($homeMount);

if ($homeMount->getStorageRootId() === -1) {
$homeMount->getStorage()->mkdir('');
$homeMount->getStorage()->getScanner()->scan('');
$homeStorage = $homeMount->getStorage();
$homeStorage->mkdir('');
$homeStorage->mkdir('files');
$homeStorage->getScanner()->scan('');
}

$provider = $homeMount->getMountProvider();
Expand Down

0 comments on commit 625ed52

Please sign in to comment.