From 5c8e7be4a7905e8cac3d7860c744f7d2ed69aab1 Mon Sep 17 00:00:00 2001 From: pjft Date: Thu, 29 Jul 2021 22:50:02 +0100 Subject: Fix bug introduced on drag and drop external files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drag and drop of external (OS filesystem) to subdirectories in the browser would fail on specific cases, mainly when the subdirectory was no longer off the root folder. This seemed to have been an issue introduced with the subdirectory free space calculation [here](https://github.com/nextcloud/server/commit/f9536b08096ed1c80391af36d33a18198be1fced) and it seems to fail for any subdirectory that doesn't belong to the root folder. Bug reports: - https://help.nextcloud.com/t/drag-drop-into-subfolders/120731 - https://github.com/nextcloud/server/issues/24720 I couldn't find any reference on scenarios or quota management that would suggest when a subdirectory's free space would be different to the parent's free space, other than when on the root folder, where subdirectories can be external mounts. As such, if my understanding is correct (please review), this calculation can - and should - be made by getting the free space from the first subdirectory in the total path, which caters for all subdirectory scenarios. Please advise, happy to help improve this. Co-authored-by: John Molakvoæ Signed-off-by: pjft --- apps/files/tests/js/fileUploadSpec.js | 1 + 1 file changed, 1 insertion(+) (limited to 'apps/files/tests') diff --git a/apps/files/tests/js/fileUploadSpec.js b/apps/files/tests/js/fileUploadSpec.js index 6ce0558d22d..05aea446fe9 100644 --- a/apps/files/tests/js/fileUploadSpec.js +++ b/apps/files/tests/js/fileUploadSpec.js @@ -75,6 +75,7 @@ describe('OC.Upload tests', function() { files: [file], jqXHR: jqXHR, response: sinon.stub().returns(jqXHR), + targetDir: "/", submit: sinon.stub(), abort: sinon.stub() }; -- cgit v1.2.3