MDL-30880 grade: added a check for the feedback property existing before it is used
authorAndrew Davis <andrew@moodle.com>
Mon, 28 May 2012 01:15:28 +0000 (08:15 +0700)
committerAndrew Davis <andrew@moodle.com>
Mon, 4 Jun 2012 02:17:06 +0000 (09:17 +0700)
grade/edit/tree/grade.php

index 0a0c2c5..d44b2ca 100644 (file)
@@ -171,7 +171,7 @@ if ($mform->is_cancelled()) {
 // form processing
 } else if ($data = $mform->get_data(false)) {
 
-    if (is_array($data->feedback)) {
+    if (isset($data->feedback) && is_array($data->feedback)) {
         $data->feedbackformat = $data->feedback['format'];
         $data->feedback = $data->feedback['text'];
     }