MDL-51939 mod_forum: Correct empty groupinfo check

This commit is contained in:
Andrew Nicols
2015-10-28 14:04:44 +08:00
parent 23eb923bcc
commit ba7fcebb79
3 changed files with 10 additions and 2 deletions
+8
View File
@@ -240,5 +240,13 @@ function xmldb_forum_upgrade($oldversion) {
// Moodle v2.8.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2014111002) {
// Groupid = 0 is never valid.
$DB->set_field('forum_discussions', 'groupid', -1, array('groupid' => 0));
// Forum savepoint reached.
upgrade_mod_savepoint(true, 2014111002, 'forum');
}
return true;
}
+1 -1
View File
@@ -840,7 +840,7 @@ if ($mform_post->is_cancelled()) {
// 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 = 2014111001; // The current module version (Date: YYYYMMDDXX)
$plugin->version = 2014111002; // The current module version (Date: YYYYMMDDXX)
$plugin->requires = 2014110400; // Requires this Moodle version
$plugin->component = 'mod_forum'; // Full name of the plugin (used for diagnostics)