mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Few small fixes
This commit is contained in:
parent
f2269f311d
commit
285f94f506
1 changed files with 4 additions and 3 deletions
|
@ -506,9 +506,10 @@ function get_courses($categoryid="all", $sort="c.sortorder ASC", $fields="c.*")
|
|||
// loop throught them
|
||||
foreach ($courses as $course) {
|
||||
|
||||
if ($course->visible <= 0) {
|
||||
if (isset($course->visible) && $course->visible <= 0) {
|
||||
// for hidden courses, require visibility check
|
||||
if (has_capability('moodle/course:viewhiddencourses', get_context_instance(CONTEXT_COURSE, $course->id))) {
|
||||
if (has_capability('moodle/course:viewhiddencourses',
|
||||
get_context_instance(CONTEXT_COURSE, $course->id))) {
|
||||
$visiblecourses [] = $course;
|
||||
}
|
||||
} else {
|
||||
|
@ -586,7 +587,7 @@ function get_courses_page($categoryid="all", $sort="c.sortorder ASC", $fields="c
|
|||
$limitnum = count($courses);
|
||||
}
|
||||
|
||||
if (!limitfrom) {
|
||||
if (!$limitfrom) {
|
||||
$limitfrom = 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue