Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-6216 print_category_info no longer counts invisible courses if th…

…e user does't have permission to see them.
  • Loading branch information...
commit 7ffcbfe15201b96bf220cad1c4d043470edc9925 1 parent 18159e2
jmg324 authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 course/lib.php
View
6 course/lib.php
@@ -1734,8 +1734,8 @@ function print_category_info($category, $depth, $files = false) {
echo "\n\n".'<table class="categorylist">';
+ $courses = get_courses($category->id, 'c.sortorder ASC', 'c.id,c.sortorder,c.visible,c.fullname,c.shortname,c.password,c.summary,c.guest,c.cost,c.currency');
if ($files and $coursecount) {
- $courses = get_courses($category->id, 'c.sortorder ASC', 'c.id,c.sortorder,c.visible,c.fullname,c.shortname,c.password,c.summary,c.guest,c.cost,c.currency');
echo '<tr>';
@@ -1798,8 +1798,8 @@ function print_category_info($category, $depth, $files = false) {
echo '<a '.$catlinkcss.' href="'.$CFG->wwwroot.'/course/category.php?id='.$category->id.'">'. format_string($category->name).'</a>';
echo '</td>';
echo '<td valign="top" class="category number">';
- if ($category->coursecount) {
- echo $category->coursecount;
+ if (count($courses)) {
+ echo count($courses);
}
echo '</td></tr>';
}
Please sign in to comment.
Something went wrong with that request. Please try again.