MDL-50394 core_course: fixed form validation of 'gradepass'

This commit is contained in:
Mark Nelson 2015-06-01 00:22:33 -07:00
parent 0c6faf4b51
commit 9758da6ed5
2 changed files with 18 additions and 4 deletions

View file

@ -262,6 +262,12 @@ if ($mform->is_cancelled()) {
redirect(course_get_url($course, $cw->section, array('sr' => $sectionreturn)));
}
} else if ($fromform = $mform->get_data()) {
// Convert the grade pass value - we may be using a language which uses commas,
// rather than decimal points, in numbers. These need to be converted so that
// they can be added to the DB.
if (isset($fromform->gradepass)) {
$fromform->gradepass = unformat_float($fromform->gradepass);
}
if (!empty($fromform->update)) {
list($cm, $fromform) = update_moduleinfo($cm, $fromform, $course, $mform);