From bdf5c2920fbd57bf72e79a1dd7e0a04c1ec95d32 Mon Sep 17 00:00:00 2001 From: Rossco Hellmans Date: Fri, 8 Nov 2024 18:41:32 +1000 Subject: [PATCH] MDL-66129 course_module: include lib.php before calling _refresh_events Before checking for and calling the module _refresh_events function in course_module_calendar_event_update_process, the module lib.php file needs to be included if it has not been already. --- course/lib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/course/lib.php b/course/lib.php index 1d9265d3c3e9d..e8fd2d4c2dfde 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1031,8 +1031,11 @@ function course_module_bulk_update_calendar_events($modulename, $courseid = 0) { * @since Moodle 3.3.4 */ function course_module_calendar_event_update_process($instance, $cm) { + global $CFG; + // We need to call *_refresh_events() first because some modules delete 'old' events at the end of the code which // will remove the completion events. + include_once("$CFG->dirroot/mod/$cm->modname/lib.php"); $refresheventsfunction = $cm->modname . '_refresh_events'; if (function_exists($refresheventsfunction)) { call_user_func($refresheventsfunction, $cm->course, $instance, $cm);