MDL-8455 - merged from MOODLE_18_STABLE

This commit is contained in:
poltawski 2007-03-14 13:08:00 +00:00
parent 20fe12b4a2
commit 650408a336

View File

@ -1743,7 +1743,7 @@ function print_courses($category, $hidesitecourse = false) {
if (empty($category)) {
$categories = get_categories(0); // Parent = 0 ie top-level categories only
if (count($categories) == 1) {
if ($categories != null and count($categories) == 1) {
$category = array_shift($categories);
$courses = get_courses($category->id, 'c.sortorder ASC', 'c.id,c.category,c.sortorder,c.visible,c.fullname,c.shortname,c.password,c.summary,c.teacher,c.cost,c.currency,c.enrol,c.guest');
} else {