From f6967a974f430a60cb3e3ccdf5b27c46eb27a200 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 1 Mar 2019 12:03:28 +0100 Subject: [PATCH 1/2] Revert "Fix for issue 10862: calculation of free space ignores external storage (doesn't count towards quota)" This reverts commit e806aa658c16fadad465504fab4aeef314832bdb. Signed-off-by: Morris Jobke --- apps/files_trashbin/lib/Trashbin.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 5adbdeca6a..96c6a4c0af 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -680,10 +680,11 @@ class Trashbin { // calculate available space for trash bin // subtract size of files and current trash bin size from quota if ($softQuota) { - $files_view = new View('/' . $user . '/files'); - $rootInfo = $files_view->getFileInfo('/', false); - $free = $quota - $rootInfo['size']; // remaining free space for user - + $userFolder = \OC::$server->getUserFolder($user); + if(is_null($userFolder)) { + return 0; + } + $free = $quota - $userFolder->getSize(); // remaining free space for user if ($free > 0) { $availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $trashbinSize; // how much space can be used for versions } else { From 4704e719edcdb418624e93ca75592ff0cd39fa13 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 1 Mar 2019 12:05:18 +0100 Subject: [PATCH 2/2] Only fetch size of this storage without mount points - ref #14412 Signed-off-by: Morris Jobke --- apps/files_trashbin/lib/Trashbin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 96c6a4c0af..1d0d537990 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -684,7 +684,7 @@ class Trashbin { if(is_null($userFolder)) { return 0; } - $free = $quota - $userFolder->getSize(); // remaining free space for user + $free = $quota - $userFolder->getSize(false); // remaining free space for user if ($free > 0) { $availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $trashbinSize; // how much space can be used for versions } else {