]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed some notices but this needs review from Petr MDL-10383
authormoodler <moodler>
Wed, 3 Oct 2007 09:12:01 +0000 (09:12 +0000)
committermoodler <moodler>
Wed, 3 Oct 2007 09:12:01 +0000 (09:12 +0000)
lib/grouplib.php

index f85b9685b9073b49e4be2051bf2d3fcf01916151..8f9ca2487bc2d3eaa8f13673a27024f34436b003 100644 (file)
@@ -422,7 +422,7 @@ function groups_get_course_group($course, $update=false) {
         $SESSION->activegroup[$course->id] = array(SEPARATEGROUPS=>array(), VISIBLEGROUPS=>array(), 'aag'=>array());
     }
 
-    $context = get_context_instance(CONTEXT_MODULE, $cm->id);
+    $context = get_context_instance(CONTEXT_COURSE, $course->id);
     if (has_capability('moodle/site:accessallgroups', $context)) {
         $groupmode = 'aag';
     }
@@ -446,7 +446,6 @@ function groups_get_course_group($course, $update=false) {
     // set new active group if requested
     $changegroup = optional_param('group', -1, PARAM_INT);
     if ($update and $changegroup != -1) {
-        $context = get_context_instance(CONTEXT_COURSE, $course->id);
 
         if ($changegroup == 0) {
             // do not allow changing to all groups without accessallgroups capability