in /user/profile.php
if (!isset($hiddenfields['mycourses'])) {
|
if ($mycourses = enrol_get_users_courses($user->id, true, NULL, 'visible DESC,sortorder ASC')) {
|
$shown=0;
|
$courselisting = '';
|
foreach ($mycourses as $mycourse) {
|
if ($mycourse->category) {
|
$class = '';
|
if ($mycourse->visible == 0) {
|
$ccontext = get_context_instance(CONTEXT_COURSE, $mycourse->id);
|
if (!has_capability('moodle/course:viewhiddencourses', $ccontext)) {
|
continue;
|
}
|
$class = 'class="dimmed"';
|
}
|
$courselisting .= "<a href=\"{$CFG->wwwroot}/user/view.php?id={$user->id}&course={$mycourse->id}\" $class >" . format_string($mycourse->fullname) . "</a>, ";
|
}
|
$shown++;
|
if($shown==20) {
|
$courselisting.= "...";
|
break;
|
}
|
}
|
print_row(get_string('courseprofiles').':', rtrim($courselisting,', '));
|
}
|
}
|
"What is the purpose of the $mycourse->category check? Category should always be set." - am in MDL-26774 about the get_users_by_id that was copied from this above piece of code
if MDL-26774 come to be resolved before this issue, then the error will probably be there too and you need to fix it too !
- has been marked as being related by
-
MDL-26774 Fix moodle_user_get_users_by_id
-
- Closed
-