MDL-28221 resource: improved file not found handling
When the referenced file is not found, do not rely on the record in resource_old as the resource can be actually restored from a 1.9 backup.
This commit is contained in:
@@ -345,7 +345,11 @@ function resource_print_filenotfound($resource, $cm, $course) {
|
||||
resource_print_header($resource, $cm, $course);
|
||||
resource_print_heading($resource, $cm, $course);
|
||||
resource_print_intro($resource, $cm, $course);
|
||||
echo $OUTPUT->notification(get_string('notmigrated', 'resource', $resource_old->type));
|
||||
if ($resource_old) {
|
||||
echo $OUTPUT->notification(get_string('notmigrated', 'resource', $resource_old->type));
|
||||
} else {
|
||||
echo $OUTPUT->notification(get_string('filenotfound', 'resource'));
|
||||
}
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user