From: defacer Date: Fri, 7 May 2004 10:15:10 +0000 (+0000) Subject: Fix for bug 1320: X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bd1195678c47e40e7bb3ada783419d9436af2b93;p=moodle.git Fix for bug 1320: Upcoming events were not displayed before calendar_session_vars() was called at least once. The upcoming events block did not do that, because once upon a time it was displayed below the month view, which was known to do it :) Solution: calendar_session_vars() is now called directly from lib.php. --- diff --git a/blocks/calendar_month/block_calendar_month.php b/blocks/calendar_month/block_calendar_month.php index fb7484daf4..10b419da8c 100644 --- a/blocks/calendar_month/block_calendar_month.php +++ b/blocks/calendar_month/block_calendar_month.php @@ -23,8 +23,6 @@ class CourseBlock_calendar_month extends MoodleBlock { $this->content->text = ''; $this->content->footer = ''; - calendar_session_vars(); - if($this->course === NULL) { // Overrides: use no course at all $courseshown = false; diff --git a/calendar/lib.php b/calendar/lib.php index 0339d4059f..651f0a7695 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -53,6 +53,9 @@ define ('CALENDAR_URL', $CFG->wwwroot.'/calendar/'); define ('CALENDAR_TF_24', '%H:%M'); define ('CALENDAR_TF_12', '%I:%M %p'); +// Initialize the session variables here to be sure +calendar_session_vars(); + function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_year = false) { global $CFG, $USER;