MDL-41848 SCORM: Drag drop SCORM upload fix
This commit is contained in:
+2
-2
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user