MDL-65694 grade: Fix missing gradelib library
authorDavid Mudrák <david@moodle.com>
Thu, 23 May 2019 05:48:54 +0000 (07:48 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Thu, 23 May 2019 08:45:55 +0000 (10:45 +0200)
In the be8f453b74fbd3 the gradelib loading was removed by mistake. So
the library may not be loaded and executing the task may end with
the exception - class 'grade_grade' not found.

lib/classes/task/grade_cron_task.php

index bfb3777..60d9f8a 100644 (file)
@@ -43,6 +43,7 @@ class grade_cron_task extends scheduled_task {
      */
     public function execute() {
         global $CFG, $DB;
+        require_once($CFG->libdir . '/gradelib.php');
 
         $now = time();
         $sql = "SELECT i.*