Skip to content
Browse files

ForumNG - Images missing from history #6105

  • Loading branch information...
1 parent 26a0a12 commit 02de2c63076fc660b1608c1b914e0e63b63edba1 @jason-platts jason-platts committed with sammarshallou
Showing with 6 additions and 1 deletion.
  1. +6 −1 mod_forumng_post.php
View
7 mod_forumng_post.php
@@ -346,9 +346,14 @@ public function get_formatted_message() {
$text = preg_replace('~([\'"]@@PLUGINFILE@@[^\'"?]+)([\'"])~',
'$1?clone=' . $forum->get_course_module_id() . '$2', $text);
}
+ $id = $this->get_id();
+ if ($this->is_old_version()) {
+ // If old version get id of parent post as images stored against this.
+ $id = $this->get_parent()->get_id();
+ }
$context = $forum->get_context(true);
$text = file_rewrite_pluginfile_urls($text, 'pluginfile.php',
- $context->id, 'mod_forumng', 'message', $this->postfields->id);
+ $context->id, 'mod_forumng', 'message', $id);
$textoptions = new stdClass();
// Don't put a <p> tag round post
$textoptions->para = false;

0 comments on commit 02de2c6

Please sign in to comment.
Something went wrong with that request. Please try again.