MDL-51735 mod_lesson: A lesson with no content shows a message.

Before it would show an error.
This commit is contained in:
Adrian Greeve
2016-07-25 10:48:14 +08:00
parent 90a8bdbfc0
commit 89644a400d
+5 -1
View File
@@ -286,7 +286,11 @@ if (empty($pageid)) {
}
// start at the first page
if (!$pageid = $DB->get_field('lesson_pages', 'id', array('lessonid' => $lesson->id, 'prevpageid' => 0))) {
print_error('cannotfindfirstpage', 'lesson');
echo $lessonoutput->header($lesson, $cm, 'view', '', null);
// Lesson currently has no content. A message for display has been prepared and will be displayed by the header method
// of the lesson renderer.
echo $lessonoutput->footer();
exit();
}
/// This is the code for starting a timed test
if(!isset($USER->startlesson[$lesson->id]) && !$canmanage) {