Error grade_floatval(): Argument #1 ($number) must be of type ?float, string given
Laur0r opened this issue · 1 comments
If the completion tracking is enabled and a gradepass element is defined in the mod_form, the validation method in mod_form.php in line 341:
if ($completionpass && (empty($data['gradepass']) || grade_floatval($data['gradepass']) == 0)) {
throws the exception grade_floatval(): Argument #1 ($number) must be of type ?float, string given
whenever the form is submitted as the given $data['gradepass']
is of type string. A conversion to float is necessary here as the grade_floatval() function has been changed since Moodle 4.0 to only except float values.
@Laur0r I created https://h5ptechnology.atlassian.net/browse/HFP-4110 on H5P Group's JIRA instance. They unfortunately rarely check github issues and for reasons that I don't know they also don't let issue generation on github trigger ticket generation on JIRA automatically.