Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Laur0r opened this issue Jan 8, 2024 · 1 comment

Comments

@Laur0r
Copy link

Laur0r commented Jan 8, 2024

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
Copy link
Contributor

otacke commented Aug 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants