From e8d39b39261e9407f48fe5aea0ff3cba75407b6c Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Thu, 4 May 2017 11:49:53 +0800 Subject: [PATCH] MDL-58803 calendar: Require calendar/lib.php --- lib/classes/task/calendar_cron_task.php | 2 +- lib/deprecatedlib.php | 1 + lib/tests/calendar_cron_task_test.php | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) 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. *