From: nicolasconnault Date: Fri, 5 Oct 2007 05:40:56 +0000 (+0000) Subject: MDL-11500 Catching empty $coursemod when viewhiddensection is false, + corrected... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5a81060351a42d8ee4af080b16b4e4ade40af494;p=moodle.git MDL-11500 Catching empty $coursemod when viewhiddensection is false, + corrected type $coursemode => $coursemod --- 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; }