MDL-37411 Note Module: additional patch to fixed undefined property for stable branches
authorRossiani Wijaya <rwijaya@moodle.com>
Wed, 6 Mar 2013 07:18:44 +0000 (15:18 +0800)
committerAparup Banerjee <aparup@moodle.com>
Thu, 7 Mar 2013 03:09:17 +0000 (11:09 +0800)
notes/lib.php

index 0744211..4fc3891 100644 (file)
@@ -100,10 +100,11 @@ function note_save(&$note) {
         // insert new note
         $note->created = $note->lastmodified;
         $id = $DB->insert_record('post', $note);
-        $note = $DB->get_record('post', array('id'=>$id));
+        $note = note_load($id);
     } else {
         // update old note
         $DB->update_record('post', $note);
+        $note = note_load($note->id);
     }
     unset($note->module);
     return true;