diff --git a/course/topics.php b/course/topics.php index a91cd48063b..7f2970d737f 100644 --- a/course/topics.php +++ b/course/topics.php @@ -146,7 +146,10 @@ echo "
cellheading2\">$weekday - $endweekday
"; - if (! $thisweek = $sections[$week]) { + if (!empty($sections[$week])) { + $thisweek = $sections[$week]; + } else { $thisweek->course = $course->id; // Create a new week structure $thisweek->section = $week; $thisweek->summary = "";