Skip to content

Commit

Permalink
MDL-66213 report_loglive: Do not look up course 0
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols authored and sarjona committed Jan 14, 2020
1 parent f6fe70d commit 16d4515
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions report/loglive/classes/renderable.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,17 @@ protected function setup_filters() {
$filter = new \stdClass();
if (!empty($this->course)) {
$filter->courseid = $this->course->id;
$context = context_course::instance($filter->courseid);
if (!has_capability('moodle/site:viewanonymousevents', $context)) {
$filter->anonymous = 0;
}
} else {
$filter->courseid = 0;
}
$filter->logreader = $readers[$this->selectedlogreader];
$filter->date = $this->date;
$filter->orderby = $this->order;

$context = context_course::instance($filter->courseid);
if (!has_capability('moodle/site:viewanonymousevents', $context)) {
$filter->anonymous = 0;
}

return $filter;
}

Expand Down

0 comments on commit 16d4515

Please sign in to comment.