Skip to content

Commit

Permalink
MDL-55749 badges: define global before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajesh Taneja committed Sep 6, 2016
1 parent 5c33a0d commit 3b73ba8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion badges/criteria/award_criteria_activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct($record) {

$this->course = $DB->get_record_sql('SELECT c.id, c.enablecompletion, c.cacherev, c.startdate
FROM {badge} b INNER JOIN {course} c ON b.courseid = c.id
WHERE b.id = :badgeid ', array('badgeid' => $this->badgeid));
WHERE b.id = :badgeid ', array('badgeid' => $this->badgeid), MUST_EXIST);
$this->courseid = $this->course->id;
}

Expand Down
4 changes: 2 additions & 2 deletions badges/criteria/award_criteria_course.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct($record) {

$this->course = $DB->get_record_sql('SELECT c.id, c.enablecompletion, c.cacherev, c.startdate
FROM {badge} b INNER JOIN {course} c ON b.courseid = c.id
WHERE b.id = :badgeid ', array('badgeid' => $this->badgeid));
WHERE b.id = :badgeid ', array('badgeid' => $this->badgeid), MUST_EXIST);
$this->courseid = $this->course->id;
}

Expand Down Expand Up @@ -95,7 +95,7 @@ public function config_form_criteria($data) {
* @return string
*/
public function get_details($short = '') {
global $DB;
global $DB, $OUTPUT;
$param = reset($this->params);

$course = $DB->get_record('course', array('id' => $param['course']));
Expand Down

0 comments on commit 3b73ba8

Please sign in to comment.