mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Fixes for Bug 5749 and Bug 5750
summary of bug 5749 and 5750 fixes for: function causes timeout when deleting temporary files for large scorm objects scorm\validate.php calls function scorm_delete_files from scorm\lib.php - but lib.php not included in validate.php Validation of Scorm objects broken - adds entry in modules database even when scorm object is not created.
This commit is contained in:
parent
1e0c4d67fd
commit
e4aa175a92
@ -57,7 +57,9 @@ if (!isset($CFG->scorm_framewidth)) {
|
||||
* @return int
|
||||
*/
|
||||
function scorm_add_instance($scorm) {
|
||||
|
||||
if(empty($scorm->datadir)) { //check to make sure scorm object is valid BEFORE entering it in the database.
|
||||
error(get_string('nomanifest', 'scorm'));
|
||||
} else {
|
||||
global $CFG;
|
||||
$scorm->timemodified = time();
|
||||
|
||||
@ -86,6 +88,7 @@ function scorm_add_instance($scorm) {
|
||||
}
|
||||
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -514,6 +517,7 @@ function scorm_delete_files($directory) {
|
||||
scorm_delete_files($directory.'/'.$file);
|
||||
}
|
||||
}
|
||||
set_time_limit(5);
|
||||
}
|
||||
rmdir($directory);
|
||||
return true;
|
||||
|
@ -71,7 +71,7 @@ function scorm_validate($packagedir) {
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
if (!isset($validation)) {
|
||||
if (!isset($validation->result)) {
|
||||
$validation->result = 'nomanifest';
|
||||
$validation->pkgtype = 'SCORM';
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once('locallib.php');
|
||||
require_once('lib.php');
|
||||
|
||||
$courseid = required_param('id', PARAM_INT); // Course Module ID, or
|
||||
$reference = required_param('reference', PARAM_PATH); // Package path
|
||||
|
Loading…
x
Reference in New Issue
Block a user