From db34bb59927427dfca39224b732a620cf51fa7c6 Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 22 Aug 2003 16:20:35 +0000 Subject: [PATCH] After rebuilding cache - get the course record again --- course/view.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/course/view.php b/course/view.php index 0fec158dfe..165b903251 100644 --- a/course/view.php +++ b/course/view.php @@ -92,6 +92,9 @@ if (empty($course->modinfo)) { // Course cache was never made rebuild_course_cache($course->id); + if (! $course = get_record("course", "id", $course->id) ) { + error("That's an invalid course id"); + } } if (!file_exists("$CFG->dirroot/course/format/$course->format.php")) { // Default format is weeks -- 2.39.5