mirror of
https://github.com/moodle/moodle.git
synced 2025-04-16 14:02:32 +02:00
MDL-53566 tool_monitor: Fix context preload
This commit is contained in:
parent
bb41db9ce0
commit
bfbd733452
@ -125,7 +125,15 @@ function tool_monitor_get_user_courses() {
|
||||
$options[0] = get_string('site');
|
||||
}
|
||||
|
||||
$fields = 'fullname, visible, ctxid, ctxpath, ctxdepth, ctxlevel, ctxinstance';
|
||||
$fieldlist = array_merge(
|
||||
[
|
||||
'fullname',
|
||||
'visible',
|
||||
],
|
||||
array_values(context_helper::get_preload_record_columns('c'))
|
||||
);
|
||||
|
||||
$fields = implode(', ', $fieldlist);
|
||||
if ($courses = get_user_capability_course('tool/monitor:subscribe', null, true, $fields, $orderby)) {
|
||||
foreach ($courses as $course) {
|
||||
context_helper::preload_from_record($course);
|
||||
|
Loading…
x
Reference in New Issue
Block a user