diff --git a/lib/classes/task/calendar_cron_task.php b/lib/classes/task/calendar_cron_task.php index f4c874140ba..0eec2bfd2d8 100644 --- a/lib/classes/task/calendar_cron_task.php +++ b/lib/classes/task/calendar_cron_task.php @@ -25,7 +25,7 @@ namespace core\task; defined('MOODLE_INTERNAL') || die(); -require_once($CFG->libdir . '/cronlib.php'); +require_once($CFG->dirroot . '/calendar/lib.php'); /** * Simple task to run the calendar cron. diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 6be8c82667f..facc5f3eee1 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -6612,6 +6612,7 @@ function calendar_cron() { global $CFG, $DB; + require_once($CFG->dirroot . '/calendar/lib.php'); // In order to execute this we need bennu. require_once($CFG->libdir.'/bennu/bennu.inc.php'); diff --git a/lib/tests/calendar_cron_task_test.php b/lib/tests/calendar_cron_task_test.php index fa410b9ecf3..f17ab150ece 100644 --- a/lib/tests/calendar_cron_task_test.php +++ b/lib/tests/calendar_cron_task_test.php @@ -24,6 +24,9 @@ defined('MOODLE_INTERNAL') || die(); +global $CFG; +require_once($CFG->dirroot . '/calendar/lib.php'); + /** * Class containing unit tests for the calendar cron task. *