]> git.mjollnir.org Git - moodle.git/commitdiff
Merged from 1.6. Fixed php warnings when no course is selected.
authorvyshane <vyshane>
Fri, 2 Jun 2006 07:37:45 +0000 (07:37 +0000)
committervyshane <vyshane>
Fri, 2 Jun 2006 07:37:45 +0000 (07:37 +0000)
course/report/stats/index.php

index 6f623c2434101bc6764f3930cfb327796ea3cecf..d9cd50e063a4af83130846344a63282bdb544b7f 100644 (file)
             $sql = 'SELECT s.userid,u.firstname,u.lastname,u.idnumber,1 AS roleid FROM '.$CFG->prefix.'user_students s JOIN '.$CFG->prefix.'user u ON u.id = s.userid WHERE course = '.$course->id;
         }
 
-        $us = get_records_sql($sql);
+        if (!$us = get_records_sql($sql)) {
+            error('Cannot enter detailed view: No users found for this course.');
+        }
         $admins = get_admins();
         foreach ($us as $u) {
             $role = $course->student;