From 767761b7d84bc70b863cef41b2717cfe3616814c Mon Sep 17 00:00:00 2001 From: Adam Olley Date: Tue, 21 Feb 2017 14:31:19 +1030 Subject: [PATCH] MDL-58030 gradingform_guide: Init $commentchooser before use The initialisation of $commentschooser was moved into an IF condition, whilst still using it outside of that IF conditions scope. As such, if there are no comments to choose from, the variable is never init'd but it still goes to use it, emitting a PHP notice. --- grade/grading/form/guide/renderer.php | 1 + 1 file changed, 1 insertion(+) diff --git a/grade/grading/form/guide/renderer.php b/grade/grading/form/guide/renderer.php index 73329120f7d..a0466f5d2f2 100644 --- a/grade/grading/form/guide/renderer.php +++ b/grade/grading/form/guide/renderer.php @@ -236,6 +236,7 @@ class gradingform_guide_renderer extends plugin_renderer_base { $input = html_writer::tag('textarea', s($currentremark), $remarkparams); // Show the frequently-used comments chooser only if there are defined entries. + $commentchooser = ''; if (!empty($comments)) { // Frequently used comments chooser. $chooserbuttonid = 'criteria-' . $criterion['id'] . '-commentchooser'; -- 2.11.4.GIT