### Eclipse Workspace Patch 1.0
#P GBPv2_18STABLE
Index: lib.php
===================================================================
RCS file: /cvsroot/moodle/contrib/patches/gradebookplus_v2_1.7/lib.php,v
retrieving revision 1.3.2.10
diff -u -r1.3.2.10 lib.php
--- lib.php	5 Oct 2007 03:41:06 -0000	1.3.2.10
+++ lib.php	17 Oct 2007 19:43:37 -0000
@@ -394,7 +394,7 @@
         }
     
         // if the user has selected a group to view by get the group members
-if ($currentgroup = get_current_group($course->id)) {
+if ($currentgroup = get_current_group($course->id) && groupmode($course) != 0) {
         $groupmembers = get_group_users($currentgroup);
                  }
 
@@ -1395,7 +1395,7 @@
 /// Check to see if groups are being used in this course
     $currentgroup = get_current_group($course->id);
 
-    if ($currentgroup) {
+    if ($currentgroup  = get_current_group($course->id) && groupmode($course) != 0) {
         $students = get_group_students($currentgroup, "u.lastname ASC");
     } else {
         $students = grade_get_course_students($course->id);

