From 89644a400d463c8cc17c090f64b1d0f83857ac85 Mon Sep 17 00:00:00 2001 From: Adrian Greeve Date: Wed, 20 Jul 2016 14:45:44 +0800 Subject: [PATCH] MDL-51735 mod_lesson: A lesson with no content shows a message. Before it would show an error. --- mod/lesson/view.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mod/lesson/view.php b/mod/lesson/view.php index 94a426e944a..e7a66cd5590 100644 --- a/mod/lesson/view.php +++ b/mod/lesson/view.php @@ -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) { -- 2.43.0