mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-23781 lesson - files upgrade fatal error fixed
This commit is contained in:
parent
38ead57d34
commit
7dcce47503
@ -213,7 +213,7 @@ function xmldb_lesson_upgrade($oldversion) {
|
||||
$filepathname = clean_param('/'.$lesson->mediafile, PARAM_PATH);
|
||||
$fullpath = "/$context->id/mod_lesson/mediafile/0$filepathname";
|
||||
|
||||
if ($fs->get_file_by_hash(sha1($fullpath)) and !$file->is_directory()) {
|
||||
if ($file = $fs->get_file_by_hash(sha1($fullpath)) and !$file->is_directory()) {
|
||||
// already converted, just update filename
|
||||
$DB->set_field('lesson', 'mediafile', $filepathname, array('id'=>$lesson->id));
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user