MDL-51939 mod_forum: Correct empty groupinfo check

This commit is contained in:
Andrew Nicols
2015-10-28 12:11:34 +08:00
parent 840ae905cc
commit 59b8d89ba8
3 changed files with 10 additions and 2 deletions
+8
View File
@@ -181,5 +181,13 @@ function xmldb_forum_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2014051203, 'forum');
}
if ($oldversion < 2014051204) {
// Groupid = 0 is never valid.
$DB->set_field('forum_discussions', 'groupid', -1, array('groupid' => 0));
// Forum savepoint reached.
upgrade_mod_savepoint(true, 2014051204, 'forum');
}
return true;
}
+1 -1
View File
@@ -840,7 +840,7 @@ if ($fromform = $mform_post->get_data()) {
// Before we add this we must check that the user will not exceed the blocking threshold.
forum_check_blocking_threshold($thresholdwarning);
if (isset($fromform->groupinfo)) {
if (!empty($fromform->groupinfo)) {
// Use the value provided in the dropdown group selection.
$fromform->groupid = $fromform->groupinfo;
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2014051203; // The current module version (Date: YYYYMMDDXX)
$plugin->version = 2014051204; // The current module version (Date: YYYYMMDDXX)
$plugin->requires = 2014050800; // Requires this Moodle version
$plugin->component = 'mod_forum'; // Full name of the plugin (used for diagnostics)