From f9a0425f04ee3cb18c38ed6135ca720755aa3bc3 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Fri, 1 Mar 2019 12:41:35 +1300 Subject: [PATCH] Fix #371 set grade to 0 if null. --- preferences.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/preferences.php b/preferences.php index 24d6378..fe3e21a 100644 --- a/preferences.php +++ b/preferences.php @@ -70,7 +70,7 @@ switch ($att->pageparams->action) { $newdescription = optional_param('newdescription', null, PARAM_TEXT); $newgrade = optional_param('newgrade', 0, PARAM_RAW); $newstudentavailability = optional_param('newstudentavailability', null, PARAM_INT); - $newgrade = unformat_float($newgrade); + $newgrade = empty($newgrade) ? 0 : unformat_float($newgrade); $newstatus = new stdClass(); $newstatus->attendanceid = $att->id;