Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2021-09-22 13:22:31 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2021-09-22 17:23:42 +0300
commita43d664c0b43796aa0b9dd03b49d9308e51daf52 (patch)
tree8cd66b2318acab327cb0f3b9bf5961752ab7fa00
parentfa6eb1f1345abfd1dd29a67c3b6fa7fd7d934421 (diff)
Fix public shared folder page when quota includes external storagesfix-public-shared-folder-page-when-quota-includes-external-storages
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>
-rw-r--r--apps/files_sharing/lib/Controller/ShareController.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php
index 614dae7ffba..21a156dadef 100644
--- a/apps/files_sharing/lib/Controller/ShareController.php
+++ b/apps/files_sharing/lib/Controller/ShareController.php
@@ -403,6 +403,13 @@ class ShareController extends AuthPublicShareController {
$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
*/