From: nfreear Date: Tue, 24 Apr 2007 14:25:50 +0000 (+0000) Subject: Fixes bug MDL-9520, "groups_groupids_to_groups should return groups indexed by group... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=73caba13edd6558c826130f260c82c5ba9a06728;p=moodle.git Fixes bug MDL-9520, "groups_groupids_to_groups should return groups indexed by group ID". Merged from 1.8 branch. --- diff --git a/group/lib/utillib.php b/group/lib/utillib.php index 883fa594e6..e2a612e11f 100644 --- a/group/lib/utillib.php +++ b/group/lib/utillib.php @@ -178,7 +178,7 @@ function groups_groups_to_groupids($groups) { * @param $groupids Array of group IDs. * @param $courseid Default false, or the course ID for backwards compatibility. * @param $alldata Default false, or get complete record for group. - * @return array Array of group objects, with basic or all data. + * @return array Array of group objects INDEXED by group ID, with basic or all data. */ function groups_groupids_to_groups($groupids, $courseid=false, $alldata=false) { if (! $groupids) { @@ -186,7 +186,7 @@ function groups_groupids_to_groups($groupids, $courseid=false, $alldata=false) { } $groups = array(); foreach ($groupids as $id) { - $groups[] = groups_get_group_settings($id, $courseid, $alldata); + $groups[$id] = groups_get_group_settings($id, $courseid, $alldata); } return $groups; }