-
Bug
-
Resolution: Fixed
-
Minor
-
3.1.5, 3.2.2
-
MOODLE_31_STABLE, MOODLE_32_STABLE
-
MOODLE_31_STABLE, MOODLE_32_STABLE
-
MDL-58463-master -
The following logic in assign_refresh_events() is wrong:
if (!$courseid) { |
$courseid = $assign->course; |
if (!$course = $DB->get_record('course', array('id' => $courseid), '*')) { |
continue; |
}
|
}
|
In the case where the course ID parameter is not passed, then all assignment events from all courses should be refreshed. However, with the logic above, only the first course's assignments will be refreshed since for the other assignments in other courses, the expression
if (!$cm = get_coursemodule_from_instance('assign', $assign->id, $courseid, false)) {
|
continue;
|
}
|
will evaluate to true due to a non-existent course module due to the course ID not matching the assignment's course ID.
Note: This only affects 32 and 31 since the fix for this issue is already being addressed in MDL-57607 on master. This issue has not been discovered since there was basically no use-case for 32 and 31 where a course ID of 0 is being passed.
- Discovered while testing
-
MDL-57607 Write upgrade code for existing events
-
- Closed
-