From c7fc010215f22aaff9380cb308f4794d7e2bba99 Mon Sep 17 00:00:00 2001 From: pflug Date: Thu, 15 Dec 2016 10:19:55 +0100 Subject: [PATCH] Fix showConflict use getFullFileName to show conflicting file add original.directory to make fileExists happy Signed-off-by: Andreas Pflug --- apps/files/js/file-upload.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index b3a59b54241..25136d042a9 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -129,6 +129,16 @@ OC.FileUpload.prototype = { return OC.joinPaths(this._targetFolder, this.getFile().relativePath || ''); }, + /** + * Get full path for the target file, + * including relative path and file name. + * + * @return {String} full path + */ + getFullFilePath: function() { + return OC.joinPaths(this.getFullPath(), this.getFile().name); + }, + /** * Returns conflict resolution mode. * @@ -508,9 +518,10 @@ OC.Uploader.prototype = _.extend({ return; } // retrieve more info about this file - this.filesClient.getFileInfo(fileUpload.getFullPath()).then(function(status, fileInfo) { + this.filesClient.getFileInfo(fileUpload.getFullFilePath()).then(function(status, fileInfo) { var original = fileInfo; var replacement = file; + original.directory = original.path; OC.dialogs.fileexists(fileUpload, original, replacement, self); }); },