### Eclipse Workspace Patch 1.0
#P scheduler
Index: teacherview.controller.php
===================================================================
RCS file: /cvsroot/moodle/contrib/plugins/mod/scheduler/teacherview.controller.php,v
retrieving revision 1.2.2.7
diff -u -r1.2.2.7 teacherview.controller.php
--- teacherview.controller.php	24 Jun 2009 23:01:53 -0000	1.2.2.7
+++ teacherview.controller.php	6 Nov 2009 18:05:01 -0000
@@ -416,7 +416,7 @@
 
         if ($slot = get_record('scheduler_slots', 'id', $slotid)){
             // unassign student to the slot
-            $oldstudents = get_records('scheduler_appointment', 'slotid', $slot->id, '', 'id,id');
+            $oldstudents = get_records('scheduler_appointment', 'slotid', $slot->id, '', 'id,studentid');
             
             if ($oldstudents){            
                 foreach($oldstudents as $oldstudent){
@@ -430,7 +430,7 @@
             // notify student
             if ($scheduler->allownotifications && $oldstudents){
                 foreach($oldstudents as $oldstudent){
-                    $student = get_record('user', 'id', $oldstudent->id);
+                    $student = get_record('user', 'id', $oldstudent->studentid);
                     $teacher = get_record('user', 'id', $slot->teacherid);
                     include_once($CFG->dirroot.'/mod/scheduler/mailtemplatelib.php');
                     $vars = array( 'SITE' => $SITE->shortname,

