Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed a PHP5 notice

  • Loading branch information...
commit fb97c774fccc5a222f87e584a652ee108bff85a3 1 parent a97e45b
moodler authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/datalib.php
View
2  lib/datalib.php
@@ -1867,7 +1867,7 @@ function get_courses_page($categoryid="all", $sort="c.sortorder ASC", $fields="c
if (!empty($categoryselect)) {
$sqland = "AND ";
}
- if (!empty($USER)) { // May need to check they are a teacher
+ if (!empty($USER) and !empty($USER->id)) { // May need to check they are a teacher
if (!iscreator()) {
$visiblecourses = "$sqland ((c.visible > 0) OR t.userid = '$USER->id')";
$teachertable = "LEFT JOIN {$CFG->prefix}user_teachers t ON t.course=c.id";
Please sign in to comment.
Something went wrong with that request. Please try again.