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

This commit is contained in:
Dan Marsden
2012-08-02 10:48:01 +08:00
committed by Dan Poltawski
parent dd9274c4fc
commit 9d94aa3154
+3
View File
@@ -625,6 +625,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));
}