Skip to content

Commit

Permalink
Fix public shared folder page when quota includes external storages
Browse files Browse the repository at this point in the history
When the quota storage wrapper is used (that is, when the share owner
has a quota set) and "quota_include_external_storage" is enabled when
checking the free space "Filesystem::getFileInfo('', 'ext')" is called,
which requires the file system to have been initialized. This is
explicitly done now in "showShare" similar to what is done in
"downloadShare".

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
  • Loading branch information
danxuliu committed Sep 22, 2021
1 parent fa6eb1f commit a43d664
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/files_sharing/lib/Controller/ShareController.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,13 @@ public function showShare($path = ''): TemplateResponse {

$shareTmpl['dir'] = $shareNode->getRelativePath($folderNode->getPath());

// In some cases (for example, when quota includes the external
// storages) the filesystem needs to be mounted to be able to check
// the free space.
/* FIXME: We should do this all nicely in OCP */
OC_Util::tearDownFS();
OC_Util::setupFS($share->getShareOwner());

/*
* The OC_Util methods require a view. This just uses the node API
*/
Expand Down

0 comments on commit a43d664

Please sign in to comment.