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.
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user