]> git.mjollnir.org Git - moodle.git/commitdiff
forum/single MDL-18599 Merged single-discussion-owner fix from 1.9
authormoodler <moodler>
Wed, 14 Oct 2009 07:07:05 +0000 (07:07 +0000)
committermoodler <moodler>
Wed, 14 Oct 2009 07:07:05 +0000 (07:07 +0000)
mod/forum/lib.php

index c11a035d455142f0a9160d9a85972bfd9fe8266f..e80028e232e6657fcbaeaec40501a81a7babd52f 100644 (file)
@@ -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
+}