]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-11818, single post forum descript = first post
authortoyomoyo <toyomoyo>
Wed, 28 Nov 2007 05:08:51 +0000 (05:08 +0000)
committertoyomoyo <toyomoyo>
Wed, 28 Nov 2007 05:08:51 +0000 (05:08 +0000)
mod/forum/post.php

index 70f3abc9624feacd69a5505e9121a5150385a40c..0c7a44cdb90a5cb08f99a211980ea2ad0c586438 100644 (file)
             if (!forum_update_post($updatepost, $message)) {
                 error(get_string("couldnotupdate", "forum"), $errordestination);
             }
+            
+            // MDL-11818
+            if (($forum->type == 'single') && ($updatepost->parent == '0')){ // updating first post of single discussion type -> updating forum intro
+                $forum->intro = $updatepost->message;
+                $forum->timemodified = time();
+                if (!update_record("forum", $forum)) {
+                    error(get_string("couldnotupdate", "forum"), $errordestination);
+                }
+            }
 
             $timemessage = 2;
             if (!empty($message)) { // if we're printing stuff about the file upload