From 4b4c1d1d6887477f54f2167ad75213a3e689efc2 Mon Sep 17 00:00:00 2001 From: skodak Date: Fri, 8 May 2009 13:18:09 +0000 Subject: [PATCH] MDL-19068 fixed item decimals before saving item; merged from MOODLE_19_STABLE --- grade/edit/tree/category.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/grade/edit/tree/category.php b/grade/edit/tree/category.php index 4a3aabc6b3..52ff9aac13 100644 --- a/grade/edit/tree/category.php +++ b/grade/edit/tree/category.php @@ -154,6 +154,11 @@ if ($mform->is_cancelled()) { $grade_item->aggregationcoef = $grade_item_copy->aggregationcoef; } + // Handle null decimals value - must be done before update! + if (!array_key_exists('decimals', $itemdata) or $itemdata->decimals < 0) { + $grade_item->decimals = null; + } + $grade_item->outcomeid = null; // update hiding flag @@ -166,12 +171,6 @@ if ($mform->is_cancelled()) { $grade_item->set_locktime($locktime); // locktime first - it might be removed when unlocking $grade_item->set_locked($locked, false, true); - - // Handle null decimals value - if (!array_key_exists('decimals', $itemdata) or $itemdata->decimals < 0) { - $grade_item->decimals = null; - } - $grade_item->update(); // We don't need to insert it, it's already created when the category is created // set parent if needed -- 2.39.5