]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18322: Fix debug warning on course view page when forum has grouping set
authorsam_marshall <sam_marshall>
Thu, 19 Feb 2009 17:41:40 +0000 (17:41 +0000)
committersam_marshall <sam_marshall>
Thu, 19 Feb 2009 17:41:40 +0000 (17:41 +0000)
mod/forum/lib.php

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