MDL-18322: Fix debug warning on course view page when forum has grouping set

This commit is contained in:
sam_marshall 2009-02-19 17:41:40 +00:00
parent 8f0632f097
commit 3ae8d0dd80

View file

@ -2348,7 +2348,11 @@ function forum_count_discussions($forum, $cm, $course) {
if (empty($CFG->enablegroupings)) { if (empty($CFG->enablegroupings)) {
$mygroups = $modinfo->groups[0]; $mygroups = $modinfo->groups[0];
} else { } else {
if (array_key_exists($cm->groupingid, $modinfo->groups)) {
$mygroups = $modinfo->groups[$cm->groupingid]; $mygroups = $modinfo->groups[$cm->groupingid];
} else {
$mygroups = false; // Will be set below
}
} }
// add all groups posts // add all groups posts