Skip to content

Commit

Permalink
Merge pull request #294 from PhMemmel/Fix_missing_require_for_constants
Browse files Browse the repository at this point in the history
Fix requiring of constants in locallib
  • Loading branch information
Laur0r authored Mar 8, 2024
2 parents 6065d99 + e4db434 commit c18a786
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 c18a786

Please sign in to comment.