MDL-55499 mod_forum: Use context when formatting e-mail text
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 30 Mar 2017 03:37:46 +0000 (11:37 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Thu, 30 Mar 2017 03:37:46 +0000 (11:37 +0800)
mod/forum/classes/output/email/renderer.php

index 17657fd..f38b76c 100644 (file)
@@ -55,11 +55,13 @@ class renderer extends \mod_forum_renderer {
      * @return string
      */
     public function format_message_text($cm, $post) {
+        $context = \context_module::instance($cm->id);
         $message = file_rewrite_pluginfile_urls($post->message, 'pluginfile.php',
-            \context_module::instance($cm->id)->id,
+            $context->id,
             'mod_forum', 'post', $post->id);
         $options = new \stdClass();
         $options->para = true;
+        $options->context = $context;
         return format_text($message, $post->messageformat, $options);
     }