MDL-30289 forum - set page context when pruning a discussion
authorCharles Fulton <mackensen@gmail.com>
Wed, 16 Nov 2011 02:18:40 +0000 (18:18 -0800)
committeradrian@moodle.com <abgreeve@gmail.com>
Mon, 21 Nov 2011 00:58:26 +0000 (08:58 +0800)
mod/forum/post.php

index c45aeb0..197d3c2 100644 (file)
@@ -460,6 +460,8 @@ if (!empty($forum)) {      // User is starting a new discussion in a forum
 
         $course = $DB->get_record('course', array('id' => $forum->course));
 
+        $PAGE->set_cm($cm);
+        $PAGE->set_context($modcontext);
         $PAGE->navbar->add(format_string($post->subject, true), new moodle_url('/mod/forum/discuss.php', array('d'=>$discussion->id)));
         $PAGE->navbar->add(get_string("prune", "forum"));
         $PAGE->set_title(format_string($discussion->name).": ".format_string($post->subject));