Skip to content

Commit

Permalink
MDL-56893 grades: Fix edit grade item when grade_report_showmin is false
Browse files Browse the repository at this point in the history
Check to make sure $data['grademin'] exists. When grade_report_showmin
is false $data['grademin'] doesn't exist.
  • Loading branch information
mspall committed Nov 30, 2016
1 parent 258d07d commit d27e1c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion grade/edit/tree/item_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,8 @@ function validation($data, $files) {
}
if ($grade_item) {
if ($grade_item->gradetype == GRADE_TYPE_VALUE) {
if (grade_floats_different($data['grademin'], $grade_item->grademin) ||
if ((((bool) get_config('moodle', 'grade_report_showmin')) &&
grade_floats_different($data['grademin'], $grade_item->grademin)) ||
grade_floats_different($data['grademax'], $grade_item->grademax)) {
if ($grade_item->has_grades() && empty($data['rescalegrades'])) {
$errors['rescalegrades'] = get_string('mustchooserescaleyesorno', 'grades');
Expand Down

0 comments on commit d27e1c7

Please sign in to comment.