]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19068 fixed item decimals before saving item; merged from MOODLE_19_STABLE
authorskodak <skodak>
Fri, 8 May 2009 13:18:09 +0000 (13:18 +0000)
committerskodak <skodak>
Fri, 8 May 2009 13:18:09 +0000 (13:18 +0000)
grade/edit/tree/category.php

index 4a3aabc6b388c67657317c2c96e4bf0cd15742e0..52ff9aac13639d02164d1c7a9ad416593de4ce78 100644 (file)
@@ -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