MDL-51939 mod_forum: Fix groupid data on upgrade

This upgrade step addresses issues identified in MDL-51939 where the
groupid was incorrectly set. The issue itself is not present in 2.9, but
this upgrade step is required to correct any incorrect data.
This commit is contained in:
Andrew Nicols
2015-10-29 21:10:11 +08:00
parent d412f8552d
commit 7774cf96f8
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -242,6 +242,13 @@ function xmldb_forum_upgrade($oldversion) {
// Moodle v2.9.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2015102900) {
// Groupid = 0 is never valid.
$DB->set_field('forum_discussions', 'groupid', -1, array('groupid' => 0));
// Forum savepoint reached.
upgrade_mod_savepoint(true, 2015102900, 'forum');
}
return true;
}
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2015051103; // The current module version (Date: YYYYMMDDXX)
$plugin->version = 2015102900; // The current module version (Date: YYYYMMDDXX)
$plugin->requires = 2015050500; // Requires this Moodle version
$plugin->component = 'mod_forum'; // Full name of the plugin (used for diagnostics)