From: vyshane Date: Fri, 2 Jun 2006 07:37:45 +0000 (+0000) Subject: Merged from 1.6. Fixed php warnings when no course is selected. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=44e852cbead62851e61f3720270e320e1f78d619;p=moodle.git Merged from 1.6. Fixed php warnings when no course is selected. --- diff --git a/course/report/stats/index.php b/course/report/stats/index.php index 6f623c2434..d9cd50e063 100644 --- a/course/report/stats/index.php +++ b/course/report/stats/index.php @@ -115,7 +115,9 @@ $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;