Incorrect order of content processing during forum post portfolio export
authorDavid Mudrak <david.mudrak@gmail.com>
Thu, 11 Nov 2010 16:42:53 +0000 (16:42 +0000)
committerDavid Mudrak <david.mudrak@gmail.com>
Thu, 11 Nov 2010 16:42:53 +0000 (16:42 +0000)
During the portfolio export, portfolio_rewrite_pluginfile_urls() must be
called before format_text(). Otherwise some filters can interfere with
internal raw record syntax. For example, the Algebra Notation uses @@
for its own purposes and it used to break @@PLUGINFILE@@ placeholder.

mod/forum/locallib.php

index 8b324fc..3fdb5ad 100644 (file)
@@ -296,8 +296,8 @@ class forum_portfolio_caller extends portfolio_module_caller_base {
         $options = new stdClass();
         $options->para = true;
         $format = $this->get('exporter')->get('format');
-        $formattedtext = format_text($post->message, $post->messageformat, $options, $this->get('course')->id);
-        $formattedtext = portfolio_rewrite_pluginfile_urls($formattedtext, $this->modcontext->id, 'mod_forum', 'post', $post->id, $format);
+        $formattedtext = portfolio_rewrite_pluginfile_urls($post->message, $this->modcontext->id, 'mod_forum', 'post', $post->id, $format);
+        $formattedtext = format_text($formattedtext, $post->messageformat, $options, $this->get('course')->id);
 
         $output = '<table border="0" cellpadding="3" cellspacing="0" class="forumpost">';