Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions lib/Mount/MountProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function getTrashMount(
string $mountPoint,
IStorageFactory $loader,
?IUser $user,
?ICacheEntry $cacheEntry = null,
ICacheEntry $cacheEntry,
): IMountPoint {

$storage = $this->folderStorageManager->getBaseStorageForFolder($folder->id, $folder->useSeparateStorage(), $folder, null, false, 'trash');
Expand All @@ -181,24 +181,22 @@ public function getVersionsMount(
FolderDefinition $folder,
string $mountPoint,
IStorageFactory $loader,
?ICacheEntry $cacheEntry = null,
): IMountPoint {
$storage = $this->folderStorageManager->getBaseStorageForFolder($folder->id, $folder->useSeparateStorage(), $folder, null, false, 'versions');
$cacheEntry = $storage->getCache()->get('');
if (!$cacheEntry) {
$storage = $this->folderStorageManager->getBaseStorageForFolder($folder->id, $folder->useSeparateStorage(), $folder, null, false, 'versions');
$storage->getScanner()->scan('');
$cacheEntry = $storage->getCache()->get('');
if (!$cacheEntry) {
$storage->getScanner()->scan('');
$cacheEntry = $storage->getCache()->get('');
if (!$cacheEntry) {
throw new \Exception('Group folder version root is not in cache even after scanning for folder ' . $folder->id);
}
throw new \Exception('Group folder version root is not in cache even after scanning for folder ' . $folder->id);
}
}

$versionStorage = $this->getGroupFolderStorage(
FolderDefinitionWithPermissions::fromFolder($folder, $cacheEntry, Constants::PERMISSION_ALL),
null, $cacheEntry,
'versions'
null,
$cacheEntry,
'versions',
);

return new GroupMountPoint(
Expand All @@ -216,7 +214,7 @@ public function getVersionsMount(
public function getGroupFolderStorage(
FolderDefinitionWithPermissions $folder,
?IUser $user,
?ICacheEntry $rootCacheEntry,
ICacheEntry $rootCacheEntry,
string $type = 'files',
): IStorage {
if ($user) {
Expand Down
1 change: 1 addition & 0 deletions lib/Trash/TrashBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ private function setupTrashFolder(FolderDefinitionWithPermissions $folder, ?IUse
$mountPoint,
$this->storageFactory,
$user,
$folder->rootCacheEntry,
);
$this->mountManager->addMount($trashMount);
}
Expand Down
Loading