Skip to content

Commit

Permalink
MDL-14343 fixed groups_get_user_groups() when groupings disabled; mer…
Browse files Browse the repository at this point in the history
…ged from MOODLE_19_STABLE
  • Loading branch information
skodak committed Apr 13, 2008
1 parent 90f4745 commit ca182d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/grouplib.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ function groups_get_user_groups($courseid, $userid=0) {
$allgroups = array();

while ($group = rs_fetch_next_record($rs)) {
$allgroups[$group->id] = $group->id;
if (is_null($group->groupingid)) {
continue;
}
if (!array_key_exists($group->groupingid, $result)) {
$result[$group->groupingid] = array();
}
$result[$group->groupingid][$group->id] = $group->id;
$allgroups[$group->id] = $group->id;
}
rs_close($rs);

Expand Down Expand Up @@ -319,7 +319,7 @@ function groups_get_activity_groupmode($cm, $course=null) {
$course = $COURSE;
} else {
if (!$course = get_record('course', 'id', $cm->course)) {
print_error('Incorrect course id in cm');
error('Incorrect course id in cm');
}
}

Expand Down

0 comments on commit ca182d9

Please sign in to comment.