MDL-32690: Restore 1.9 backup into 2.X fails on missing assignment type

Solution is as follows:
* Allow unsupported subplugins to convert from Moodle1 to Moodle2
* On Moodle2 restore hide unsupported subplugins
* Graceful error message in assignment of unsupported subplugins
This commit is contained in:
Mark Nielsen
2013-08-29 08:48:39 -07:00
parent abb767192f
commit 0fc55f1d0a
6 changed files with 46 additions and 5 deletions
+6 -1
View File
@@ -3948,7 +3948,12 @@ function assignment_extend_settings_navigation(settings_navigation $settings, na
global $PAGE, $DB, $USER, $CFG;
$assignmentrow = $DB->get_record("assignment", array("id" => $PAGE->cm->instance));
require_once "$CFG->dirroot/mod/assignment/type/$assignmentrow->assignmenttype/assignment.class.php";
$classfile = "$CFG->dirroot/mod/assignment/type/$assignmentrow->assignmenttype/assignment.class.php";
if (!file_exists($classfile)) {
return;
}
require_once($classfile);
$assignmentclass = 'assignment_'.$assignmentrow->assignmenttype;
$assignmentinstance = new $assignmentclass($PAGE->cm->id, $assignmentrow, $PAGE->cm, $PAGE->course);