MDL-41848 SCORM: Drag drop SCORM upload fix

This commit is contained in:
Dan Marsden
2013-09-24 22:50:30 +12:00
parent 83f26f6407
commit b64bc10cb7
+2 -2
View File
@@ -121,7 +121,7 @@ function scorm_add_instance($scorm, $mform=null) {
// Store the package and verify.
if ($record->scormtype === SCORM_TYPE_LOCAL) {
if ($data = $mform->get_data()) {
if ($mform && $data = $mform->get_data()) {
$fs = get_file_storage();
$fs->delete_area_files($context->id, 'mod_scorm', 'package');
file_save_draft_area_files($data->packagefile, $context->id, 'mod_scorm', 'package',
@@ -197,7 +197,7 @@ function scorm_update_instance($scorm, $mform=null) {
$context = context_module::instance($cmid);
if ($scorm->scormtype === SCORM_TYPE_LOCAL) {
if ($data = $mform->get_data()) {
if ($mform && $data = $mform->get_data()) {
$fs = get_file_storage();
$fs->delete_area_files($context->id, 'mod_scorm', 'package');
file_save_draft_area_files($data->packagefile, $context->id, 'mod_scorm', 'package',