]> git.mjollnir.org Git - moodle.git/commitdiff
Fixes bug MDL-9520, "groups_groupids_to_groups should return groups indexed by group...
authornfreear <nfreear>
Tue, 24 Apr 2007 14:25:50 +0000 (14:25 +0000)
committernfreear <nfreear>
Tue, 24 Apr 2007 14:25:50 +0000 (14:25 +0000)
group/lib/utillib.php

index 883fa594e6a435409e1026b8af1209e85ba87228..e2a612e11f8c2bd8cf79a0c095d5490a24acd628 100644 (file)
@@ -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;
 }