diff --git a/notes/delete.php b/notes/delete.php
index <HASH>..<HASH> 100644
--- a/notes/delete.php
+++ b/notes/delete.php
@@ -41,7 +41,7 @@ if (empty($CFG->enablenotes)) {
 if (data_submitted() && confirm_sesskey()) {
 //if data was submitted and is valid, then delete note
     $returnurl = $CFG->wwwroot . '/notes/index.php?course=' . $course->id . '&amp;user=' . $note->userid;
-    if (!note_delete($noteid)) {
+    if (!note_delete($note)) {
         print_error('cannotdeletepost', 'notes', $returnurl);
     }
     redirect($returnurl);
MDL-<I> notes: passing an object rather than an id to avoid debugging message