diff --git a/lib/form/dndupload.js b/lib/form/dndupload.js index ebe96e6f903..8c612eb661e 100644 --- a/lib/form/dndupload.js +++ b/lib/form/dndupload.js @@ -1084,8 +1084,10 @@ M.form_dndupload.init = function(Y, options) { if (this.options.author) { formdata.append('author', this.options.author); } - if (this.options.filemanager) { // Filepickers do not have folders + if (this.options.filemanager && this.options.filemanager.currentpath) { // Filepickers do not have folders formdata.append('savepath', this.options.filemanager.currentpath); + } else { + formdata.append('savepath', '/'); } formdata.append('title', filename); if (overwrite) { diff --git a/lib/form/filemanager.js b/lib/form/filemanager.js index 8f9e5cba4d7..5711dfe57b0 100644 --- a/lib/form/filemanager.js +++ b/lib/form/filemanager.js @@ -159,7 +159,7 @@ M.form_filemanager.init = function(Y, options) { } params['sesskey'] = M.cfg.sesskey; params['client_id'] = this.client_id; - params['filepath'] = this.currentpath; + params['filepath'] = this.currentpath || '/'; params['itemid'] = this.options.itemid?this.options.itemid:0; if (args['params']) { for (i in args['params']) { diff --git a/repository/filepicker.js b/repository/filepicker.js index 3dd8d94c919..5b703bade03 100644 --- a/repository/filepicker.js +++ b/repository/filepicker.js @@ -1281,7 +1281,12 @@ M.core_filepicker.init = function(Y, options) { var title = selectnode.one('.fp-saveas input').get('value'); var filesource = selectnode.one('form #filesource-'+client_id).get('value'); var filesourcekey = selectnode.one('form #filesourcekey-'+client_id).get('value'); - var params = {'title':title, 'source':filesource, 'savepath': this.options.savepath, sourcekey: filesourcekey}; + var params = { + 'title': title, + 'source': filesource, + 'savepath': this.options.savepath || '/', + 'sourcekey': filesourcekey, + }; var license = selectnode.one('.fp-setlicense select'); if (license) { params['license'] = license.get('value'); @@ -1886,7 +1891,7 @@ M.core_filepicker.init = function(Y, options) { scope: scope, action:'upload', client_id: client_id, - params: {'savepath':scope.options.savepath}, + params: {'savepath': scope.options.savepath || '/'}, repository_id: scope.active_repo.id, form: {id: id, upload:true}, onerror: function(id, o, args) {