From 392d5fd41e31a69a950e6aa6f474189bbe557d49 Mon Sep 17 00:00:00 2001 From: Dongsheng Cai Date: Mon, 12 Apr 2010 03:07:40 +0000 Subject: [PATCH] MDL-21784, fixed undefined savepath parameter --- repository/filepicker.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/repository/filepicker.js b/repository/filepicker.js index 34843b86a69..6f66c8572a9 100644 --- a/repository/filepicker.js +++ b/repository/filepicker.js @@ -75,6 +75,9 @@ M.core_filepicker.init = function(Y, options) { initializer: function(options) { this.options = options; + if (!this.options.savepath) { + this.options.savepath = '/'; + } }, destructor: function() { @@ -392,11 +395,13 @@ M.core_filepicker.init = function(Y, options) { params['license'] = license.get('value'); } var author = Y.one('#text-author-'+client_id); - if (author) { + if (author){ params['author'] = author.get('value'); } if (this.options.env == 'editor') { + // in editor, images are stored in '/' only + params.savepath = '/'; var linkexternal = Y.one('#linkexternal-'+client_id).get('checked'); if (linkexternal) { params['linkexternal'] = 'yes';