Skip to content

Commit

Permalink
calendar MDL-23239 Fixed issue while adding calendar to some course p…
Browse files Browse the repository at this point in the history
…ages. Thanks Paul for the patch.
  • Loading branch information
Sam Hemelryk committed Sep 20, 2010
1 parent cd3d4a1 commit 753b799
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,12 @@ function calendar_session_vars($course=null) {
}
if ($course !== null) {
// speedup hack for calendar related blocks
if(isset($course->coursenode)) {
// coursenode has been set up, which seems to break things further down the line.
// Use a clone of $course with coursenode removed.
$course = clone $course;
unset($course->coursenode);
}
$SESSION->cal_courses_shown = array($course->id => $course);
} else {
$SESSION->cal_courses_shown = calendar_get_default_courses(true);
Expand Down

0 comments on commit 753b799

Please sign in to comment.