Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.3
-
MOODLE_24_STABLE
-
MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
-
MDL-40436-master -
-
5
-
FRONTEND Sprint 7
Description
If user is enrolled in courses from other host (host 2) by mnet, and block "Courses" is activated in actual host (host 1), error shown : 'Can not find data record in database table course'.
Steps to reproduce:
- Enrol user (user A) in course from other host (host 2) by mnet
- Activate block "Courses" in Home of host 1
- Access with user A in host 1
Error shown : 'Can not find data record in database table course'.
This is because in file:
blocks/course_list/block_course_list.php, in function get_remote_courses() |
$coursecontext = context_course::instance($course->id);
|
That's defined in the file :
lib/accesslib.php |
...
|
if (!$record = $DB->get_record('context', array('contextlevel'=>CONTEXT_COURSE, 'instanceid'=>$instanceid))) {
|
if ($course = $DB->get_record('course', array('id'=>$instanceid), 'id,category', $strictness)) {
|
...
|
but $course->id not in table 'course' because it is an MNet course.
I think solution is commented:
blocks/course_list/block_course_list.php, get_remote_courses() |
$coursecontext = context_course::instance($course->id);
|