### Eclipse Workspace Patch 1.0
#P contrib
Index: patches/gradebookplus_v2_1.7/lib.php
===================================================================
RCS file: /cvsroot/moodle/contrib/patches/gradebookplus_v2_1.7/lib.php,v
retrieving revision 1.3.2.19
diff -u -r1.3.2.19 lib.php
--- patches/gradebookplus_v2_1.7/lib.php	8 Jan 2008 19:17:25 -0000	1.3.2.19
+++ patches/gradebookplus_v2_1.7/lib.php	13 May 2008 23:22:55 -0000
@@ -1404,14 +1404,12 @@
             
 
 /// Check to see if groups are being used in this course
-
+    $students = grade_get_course_students($course->id); //see CONTRIB-404 - get all students first and then reduce if there is a group
     if (groupmode($course) !=0) {
         if ($currentgroup = get_current_group($course->id)) { // get the current group
             $students = get_group_students($currentgroup, "u.lastname ASC"); // group members of the group
-            }} 
-            else {// if not groupmode then the group is the entire course so get all course students
-                $students = grade_get_course_students($course->id);
-            }
+        }
+    } 
 
     if (!empty($students)) {
         foreach ($students as $student) {

