aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2025-03-11 12:24:18 +0100
committerAndy Scherzinger <info@andy-scherzinger.de>2025-03-20 00:54:46 +0100
commitca6357467402c396f4348f2deb3e0e40798b3f2a (patch)
tree523441b0535a6e9e77d51a2c5e3f73c068a05bf0
parentec7c8231821c158bc42e8e07f520322185cae6bd (diff)
downloadnextcloud-server-backport/51389/stable31.tar.gz
nextcloud-server-backport/51389/stable31.zip
fix: skip caching lastSeenQuotaUsage for remote sharesbackport/51389/stable31
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
-rw-r--r--apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php2
-rw-r--r--lib/private/legacy/OC_Helper.php11
2 files changed, 11 insertions, 2 deletions
diff --git a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
index 18cef58207d..f6c19787e94 100644
--- a/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
+++ b/apps/dav/tests/unit/Connector/Sabre/DirectoryTest.php
@@ -286,6 +286,7 @@ class DirectoryTest extends \Test\TestCase {
->willReturnMap([
['\OCA\Files_Sharing\SharedStorage', false],
['\OC\Files\Storage\Wrapper\Quota', false],
+ [\OCA\Files_Sharing\External\Storage::class, false],
]);
$storage->expects($this->once())
@@ -341,6 +342,7 @@ class DirectoryTest extends \Test\TestCase {
->willReturnMap([
['\OCA\Files_Sharing\SharedStorage', false],
['\OC\Files\Storage\Wrapper\Quota', true],
+ [\OCA\Files_Sharing\External\Storage::class, false],
]);
$storage->expects($this->once())
diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php
index 087ea3ef88b..a89cbe1bb3a 100644
--- a/lib/private/legacy/OC_Helper.php
+++ b/lib/private/legacy/OC_Helper.php
@@ -541,9 +541,16 @@ class OC_Helper {
$relative = 0;
}
+ /*
+ * \OCA\Files_Sharing\External\Storage returns the cloud ID as the owner for the storage.
+ * It is unnecessary to query the user manager for the display name, as it won't have this information.
+ */
+ $isRemoteShare = $storage->instanceOfStorage(\OCA\Files_Sharing\External\Storage::class);
+
$ownerId = $storage->getOwner($path);
$ownerDisplayName = '';
- if ($ownerId !== false) {
+
+ if ($isRemoteShare === false && $ownerId !== false) {
$ownerDisplayName = \OC::$server->getUserManager()->getDisplayName($ownerId) ?? '';
}
@@ -565,7 +572,7 @@ class OC_Helper {
'mountPoint' => trim($mountPoint, '/'),
];
- if ($ownerId && $path === '/') {
+ if ($isRemoteShare === false && $ownerId !== false && $path === '/') {
// If path is root, store this as last known quota usage for this user
\OCP\Server::get(\OCP\IConfig::class)->setUserValue($ownerId, 'files', 'lastSeenQuotaUsage', (string)$relative);
}