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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user