Skip to content

Commit

Permalink
MDL-58030 gradingform_guide: Init $commentchooser before use
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aolley committed Feb 21, 2017
1 parent 9ec952f commit 767761b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions grade/grading/form/guide/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ public function criterion_template($mode, $options, $elementname = '{NAME}', $cr
$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';
Expand Down

0 comments on commit 767761b

Please sign in to comment.