diff --git a/mod/data/rate.php b/mod/data/rate.php
index <HASH>..<HASH> 100755
--- a/mod/data/rate.php
+++ b/mod/data/rate.php
@@ -17,6 +17,8 @@ if (!$course = $DB->get_record('course', array('id'=>$data->course))) {
 
 if (!$cm = get_coursemodule_from_instance('data', $data->id)) {
     print_error('invalidcoursemodule');
+} else {
+    $data->cmidnumber = $cm->id; //MDL-12961
 }
 
 require_login($course, false, $cm);
NOBUG: Fix notice (and something more?). Like MDL-<I> but in data module; merged from <I>_STABLE