MDL-26272 ratings - fix uses breaking after last modinfo changes
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Fri, 4 Feb 2011 16:30:51 +0000 (17:30 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Fri, 4 Feb 2011 16:30:51 +0000 (17:30 +0100)
mod/data/view.php
mod/forum/lib.php
mod/glossary/view.php

index 037f9fd..d94443d 100755 (executable)
@@ -666,7 +666,7 @@ if ($showactivity) {
                 require_once($CFG->dirroot.'/rating/lib.php');
                 if ($data->assessed!=RATING_AGGREGATE_NONE) {
                     $ratingoptions = new stdclass();
-                    $ratingoptions->context = $cm->context;
+                    $ratingoptions->context = $context;
                     $ratingoptions->items = $records;
                     $ratingoptions->aggregate = $data->assessed;//the aggregation method
                     $ratingoptions->scaleid = $data->scale;
index df7c7cd..cf69cb7 100644 (file)
@@ -5318,7 +5318,7 @@ function forum_print_discussion($course, $cm, $forum, $discussion, $post, $mode,
     //load ratings
     if ($forum->assessed!=RATING_AGGREGATE_NONE) {
         $ratingoptions = new stdclass();
-        $ratingoptions->context = $cm->context;
+        $ratingoptions->context = $modcontext;
         $ratingoptions->items = $posts;
         $ratingoptions->aggregate = $forum->assessed;//the aggregation method
         $ratingoptions->scaleid = $forum->scale;
index b20a98e..236a525 100644 (file)
@@ -395,7 +395,7 @@ if ($allentries) {
     require_once($CFG->dirroot.'/rating/lib.php');
     if ($glossary->assessed!=RATING_AGGREGATE_NONE) {
         $ratingoptions = new stdclass();
-        $ratingoptions->context = $cm->context;
+        $ratingoptions->context = $context;
         $ratingoptions->items = $allentries;
         $ratingoptions->aggregate = $glossary->assessed;//the aggregation method
         $ratingoptions->scaleid = $glossary->scale;