diff --git a/mod/forum/lib.php b/mod/forum/lib.php index c11a035d455..e80028e232e 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -127,7 +127,7 @@ function forum_add_instance($forum) { * @return bool success */ function forum_update_instance($forum) { - global $DB, $OUTPUT; + global $DB, $OUTPUT, $USER; $forum->timemodified = time(); $forum->id = $forum->instance; @@ -181,6 +181,7 @@ function forum_update_instance($forum) { $post->subject = $forum->name; $post->message = $forum->intro; $post->modified = $forum->timemodified; + $post->userid = $USER->id; // MDL-18599, so that current teacher can take ownership of activities $DB->update_record('forum_posts', $post); $discussion->name = $forum->name; @@ -8353,4 +8354,4 @@ function forum_extend_settings_navigation($settingsnav, $module=null) { } return $forumkey; -} \ No newline at end of file +}