h5p / moodle-mod_hvp

H5P Plugin for Moodle
GNU General Public License v3.0
131 stars 169 forks source link

Error grade_floatval(): Argument #1 ($number) must be of type ?float, string given #532

Open Laur0r opened 9 months ago

Laur0r commented 9 months ago

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.

otacke commented 1 month ago

@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.