From: moodler Date: Tue, 4 May 2004 01:58:20 +0000 (+0000) Subject: Quick fix for bug 1303 ... but I'll come back to this today X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=8a3cfc4d76442a66554b9c5a47ef86e5191d6266;p=moodle.git Quick fix for bug 1303 ... but I'll come back to this today --- diff --git a/calendar/event.php b/calendar/event.php index ba6f05d050..83d98df884 100644 --- a/calendar/event.php +++ b/calendar/event.php @@ -176,10 +176,14 @@ // Let's see if we are supposed to provide a referring course link // but NOT for the front page - if($SESSION->cal_course_referer > 1 && - ($shortname = get_field('course', 'shortname', 'id', $SESSION->cal_course_referer)) !== false) { - // If we know about the referring course, show a return link - $nav = ''.$shortname.' -> '.$nav; + + if (!empty($SESSION->cal_course_referer)) { + if ($course = get_record('course', 'id', $SESSION->cal_course_referer)) { + $shortname = $course->shortname; + $nav = ''.$shortname.' -> '.$nav; + } + } else { + $nav = ''; } print_header(get_string('calendar', 'calendar').': '.$title, $site->fullname, $nav.' -> '.$title,