Skip to content

Commit

Permalink
Fix requiring of constants in locallib
Browse files Browse the repository at this point in the history
  • Loading branch information
PhMemmel committed Mar 4, 2024
1 parent 6065d99 commit e4db434
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion classes/task/distribute_unallocated_task.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ class distribute_unallocated_task extends adhoc_task {
* @throws moodle_exception
*/
public function execute(): void {
global $DB;
global $CFG, $DB;
// Make sure to include the global definitions of constants defined in locallib.
require_once($CFG->dirroot . '/mod/ratingallocate/locallib.php');

$data = $this->get_custom_data();
if (empty($data->distributionalgorithm) ||
!in_array($data->distributionalgorithm, [ACTION_DISTRIBUTE_UNALLOCATED_EQUALLY, ACTION_DISTRIBUTE_UNALLOCATED_FILL])) {
Expand Down

0 comments on commit e4db434

Please sign in to comment.