mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-11500 Catching empty $coursemod when viewhiddensection is false, + corrected type $coursemode => $coursemod
This commit is contained in:
parent
323956abd9
commit
5a81060351
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user