From 2eb29496c813824f78884989f5be9a81379fcb82 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Fri, 5 Sep 2014 10:22:12 +1200 Subject: [PATCH] CONTRIB-5245 set up courseatts correctly --- renderables.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/renderables.php b/renderables.php index 40de409a4e5..924dda9f25d 100644 --- a/renderables.php +++ b/renderables.php @@ -381,15 +381,15 @@ public function __construct(attendance $att, $userid) { $this->groups = groups_get_all_groups($att->course->id); } else { $this->coursesatts = att_get_user_courses_attendances($userid); - $this->statuses = array(); $this->stat = array(); $this->gradable = array(); $this->grade = array(); $this->maxgrade = array(); - foreach ($this->coursesatts as $ca) { + foreach ($this->coursesatts as $atid => $ca) { // Check to make sure the user can view this cm. if (!get_fast_modinfo($ca->courseid)->instances['attendance'][$ca->attid]->uservisible) { + unset($this->courseatts[$atid]); continue; } $statuses = att_get_statuses($ca->attid); @@ -418,7 +418,6 @@ public function __construct(attendance $att, $userid) { } } } - $this->urlpath = $att->url_view()->out_omit_querystring(); $params = $att->pageparams->get_significant_params(); $params['id'] = $att->cm->id;