Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit b0e79df9776fb720ac128a1f76dfc2de5d0edd54 1 parent 6ca0ba0
@mudrd8mz mudrd8mz authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 mod/resource/locallib.php
View
6 mod/resource/locallib.php
@@ -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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.