From f7f04af620219e35eea9fda64c45f2099d1db493 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Mon, 9 Dec 2013 20:23:43 +1300 Subject: [PATCH] fix context call and debug messages from remarks code --- locallib.php | 2 +- renderer.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/locallib.php b/locallib.php index 803ea54..f5512ee 100644 --- a/locallib.php +++ b/locallib.php @@ -895,7 +895,7 @@ class attendance { } } - $totalusers = count_enrolled_users(get_context_instance(CONTEXT_MODULE, $this->cm->id), 'mod/attendance:canbelisted', $group); + $totalusers = count_enrolled_users(context_module::instance($this->cm->id), 'mod/attendance:canbelisted', $group); $usersperpage = $this->pageparams->perpage; if (!empty($this->pageparams->page) && $this->pageparams->page && $totalusers && $usersperpage) { diff --git a/renderer.php b/renderer.php index 0a58dc9..ab1983f 100755 --- a/renderer.php +++ b/renderer.php @@ -803,8 +803,12 @@ class mod_attendance_renderer extends plugin_renderer_base { } if ($reportdata->sessionslog) { - $row->cells[] = $reportdata->sessionslog[$user->id][$sess->id]->remarks; - } + if (isset($reportdata->sessionslog[$user->id][$sess->id]->remarks)) { + $row->cells[] = $reportdata->sessionslog[$user->id][$sess->id]->remarks; + } else { + $row->cells[] = ''; + } + } $table->data[] = $row; }