MDL-33022 mod_form: set correct groupid when editing an existing post

This commit is contained in:
Dan Marsden
2012-08-02 10:47:39 +08:00
committed by Dan Poltawski
parent 55a568fa7d
commit a024301750
+3
View File
@@ -627,6 +627,9 @@ if ($fromform = $mform_post->get_data()) {
// If the user has access to all groups and they are changing the group, then update the post.
if ($contextcheck) {
if (empty($fromform->groupinfo)) {
$fromform->groupinfo = -1;
}
$DB->set_field('forum_discussions' ,'groupid' , $fromform->groupinfo, array('firstpost' => $fromform->id));
}