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 ""; - if (! $thissection = $sections[$section]) { + if (!empty($sections[$section])) { + $thissection = $sections[$section]; + + } else { $thissection->course = $course->id; // Create a new section structure $thissection->section = $section; $thissection->summary = ""; diff --git a/course/weeks.php b/course/weeks.php index dbcfaf283d2..b76b7b764ea 100644 --- a/course/weeks.php +++ b/course/weeks.php @@ -147,7 +147,9 @@ echo ""; 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 = "";