Skip to content

Commit

Permalink
MDL-66129 course_module: include lib.php before calling _refresh_events
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rhell4 committed Nov 10, 2024
1 parent 2b337b4 commit bdf5c29
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bdf5c29

Please sign in to comment.