diff --git a/mod/data/lib.php b/mod/data/lib.php
index <HASH>..<HASH> 100755
--- a/mod/data/lib.php
+++ b/mod/data/lib.php
@@ -1453,7 +1453,7 @@ function data_print_comments($data, $record, $page=0, $mform=false) {
 
     if (!$mform and !$editor) {
         echo '<div class="newcomment" style="text-align:center">';
-        echo '<a href="view.php?d='.$data->id.'&amp;page='.$page.'&amp;mode=single&amp;addcomment=1">'.get_string('addcomment', 'data').'</a>';
+        echo '<a href="view.php?d='.$data->id.'&amp;rid='.$record->id.'&amp;mode=single&amp;addcomment=1">'.get_string('addcomment', 'data').'</a>';
         echo '</div>';
     } else {
         if (!$mform) {
"DATA/MDL-<I>, use rid instead page to comment a record, merged from <I>"