From 5a81060351a42d8ee4af080b16b4e4ade40af494 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Fri, 5 Oct 2007 05:40:56 +0000 Subject: [PATCH] MDL-11500 Catching empty $coursemod when viewhiddensection is false, + corrected type $coursemode => $coursemod --- course/recent.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/course/recent.php b/course/recent.php index b84172cc31..cdf1de2244 100644 --- a/course/recent.php +++ b/course/recent.php @@ -164,11 +164,16 @@ WHERE course = '$course->id' $hiddenfilter AND m.id = cm.module $activityfilter AND cm.id = '$sectionmod'"); + + if (!$coursemod) { + continue; + } + $groupmode = groups_get_activity_groupmode($coursemod); switch ($groupmode) { case SEPARATEGROUPS : $groupid = 0; - if ($mygroups = groups_get_all_groups($course->id, $USER->id, $coursemode->groupingid)) { + if ($mygroups = groups_get_all_groups($course->id, $USER->id, $coursemod->groupingid)) { if (array_key_exists($selectedgroup, $mygroups)) { $groupid = $selectedgroup; } -- 2.39.5