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
path: root/apps
diff options
context:
space:
mode:
authorLouis <6653109+artonge@users.noreply.github.com>2021-10-14 11:59:45 +0300
committerGitHub <noreply@github.com>2021-10-14 11:59:45 +0300
commited533bd128807ae4e41efb590d59afe05c26668c (patch)
tree601a97460721a369381120e98f24729975e6a552 /apps
parent739b67031be765131956f25a7ced524ab4976924 (diff)
parent5c8e7be4a7905e8cac3d7860c744f7d2ed69aab1 (diff)
Merge pull request #28250 from pjft/patch-3
Fix bug introduced on drag and drop external files
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/file-upload.js7
-rw-r--r--apps/files/tests/js/fileUploadSpec.js1
2 files changed, 7 insertions, 1 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index ec017ceb08e..672fc1d770b 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -776,6 +776,10 @@ OC.Uploader.prototype = _.extend({
// no list to check against
return true;
}
+ if (upload.getTargetFolder() !== fileList.getCurrentDirectory()) {
+ // not uploading to the current folder
+ return true;
+ }
var fileInfo = fileList.findFile(file.name);
if (fileInfo) {
conflicts.push([
@@ -997,7 +1001,8 @@ OC.Uploader.prototype = _.extend({
freeSpace = $('#free_space').val()
} else if (upload.getTargetFolder().indexOf(self.fileList.getCurrentDirectory()) === 0) {
// Check subdirectory free space if file is uploaded there
- var targetSubdir = upload._targetFolder.replace(self.fileList.getCurrentDirectory(), '')
+ // Retrieve the folder destination name
+ var targetSubdir = upload._targetFolder.split('/').pop()
freeSpace = parseInt(upload.uploader.fileList.getModelForFile(targetSubdir).get('quotaAvailableBytes'))
}
if (freeSpace >= 0 && selection.totalBytes > freeSpace) {
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()
};