Skip to content

Commit

Permalink
MDL-28554 fix problematic loading of io-upload-frame
Browse files Browse the repository at this point in the history
This is a bit of a mystery, somehow 'io' module dependency is not enough to load everything, this might be caused by a regression in yui.
  • Loading branch information
skodak committed Aug 24, 2011
1 parent ef7329d commit 9d753c3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
2 changes: 1 addition & 1 deletion lib/outputrequirementslib.php
Expand Up @@ -395,7 +395,7 @@ protected function find_module($component) {
case 'core_filepicker': case 'core_filepicker':
$module = array('name' => 'core_filepicker', $module = array('name' => 'core_filepicker',
'fullpath' => '/repository/filepicker.js', 'fullpath' => '/repository/filepicker.js',
'requires' => array('base', 'node', 'node-event-simulate', 'json', 'async-queue', 'io', 'yui2-button', 'yui2-container', 'yui2-layout', 'yui2-menu', 'yui2-treeview', 'yui2-dragdrop', 'yui2-cookie'), 'requires' => array('base', 'node', 'node-event-simulate', 'json', 'async-queue', 'io-base', 'io-upload-iframe', 'yui2-button', 'yui2-container', 'yui2-layout', 'yui2-menu', 'yui2-treeview', 'yui2-dragdrop', 'yui2-cookie'),
'strings' => array(array('add', 'repository'), array('back', 'repository'), array('cancel', 'moodle'), array('close', 'repository'), 'strings' => array(array('add', 'repository'), array('back', 'repository'), array('cancel', 'moodle'), array('close', 'repository'),
array('cleancache', 'repository'), array('copying', 'repository'), array('date', 'repository'), array('downloadsucc', 'repository'), array('cleancache', 'repository'), array('copying', 'repository'), array('date', 'repository'), array('downloadsucc', 'repository'),
array('emptylist', 'repository'), array('error', 'repository'), array('federatedsearch', 'repository'), array('emptylist', 'repository'), array('error', 'repository'), array('federatedsearch', 'repository'),
Expand Down
46 changes: 22 additions & 24 deletions repository/filepicker.js
Expand Up @@ -1171,31 +1171,29 @@ M.core_filepicker.init = function(Y, options) {
scope.print_msg(M.str.repository.nofilesattached, 'error'); scope.print_msg(M.str.repository.nofilesattached, 'error');
return false; return false;
} }
Y.use('io-upload-iframe', function() { scope.request({
scope.request({ scope: scope,
scope: scope, action:'upload',
action:'upload', client_id: client_id,
client_id: client_id, params: {'savepath':scope.options.savepath},
params: {'savepath':scope.options.savepath}, repository_id: scope.active_repo.id,
repository_id: scope.active_repo.id, form: {id: id, upload:true},
form: {id: id, upload:true}, callback: function(id, o, args) {
callback: function(id, o, args) { if (scope.options.editor_target&&scope.options.env=='editor') {
if (scope.options.editor_target&&scope.options.env=='editor') { scope.options.editor_target.value=o.url;
scope.options.editor_target.value=o.url; scope.options.editor_target.onchange();
scope.options.editor_target.onchange();
}
scope.hide();
o.client_id = client_id;
var formcallback_scope = null;
if (args.scope.options.magicscope) {
formcallback_scope = args.scope.options.magicscope;
} else {
formcallback_scope = args.scope;
}
scope.options.formcallback.apply(formcallback_scope, [o]);
} }
}, true); scope.hide();
}); o.client_id = client_id;
var formcallback_scope = null;
if (args.scope.options.magicscope) {
formcallback_scope = args.scope.options.magicscope;
} else {
formcallback_scope = args.scope;
}
scope.options.formcallback.apply(formcallback_scope, [o]);
}
}, true);
}, this); }, this);
}, },
print_header: function() { print_header: function() {
Expand Down

0 comments on commit 9d753c3

Please sign in to comment.