diff --git a/mod/forum/post.php b/mod/forum/post.php index 94a13fbf7d2..a9105f8362d 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -737,7 +737,8 @@ $mformpost->set_data( 'subject' => $post->subject, 'message' => array( 'text' => $currenttext, - 'format' => empty($post->messageformat) ? editors_get_preferred_format() : $post->messageformat, + 'format' => !isset($post->messageformat) || !is_numeric($post->messageformat) ? + editors_get_preferred_format() : $post->messageformat, 'itemid' => $draftideditor ), 'discussionsubscribe' => $discussionsubscribe,