MDL-23781 lesson - files upgrade fatal error fixed

This commit is contained in:
Eloy Lafuente 2010-08-22 21:02:56 +00:00
parent 38ead57d34
commit 7dcce47503

View File

@ -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 {