MDL-42904 self_enrol: Set customint1 if it's null

This commit is contained in:
Rajesh Taneja 2013-11-21 13:53:24 +08:00
parent b58bc15af5
commit 95cf93b9f4
2 changed files with 9 additions and 1 deletions

View File

@ -53,6 +53,14 @@ function xmldb_enrol_self_upgrade($oldversion) {
// Put any upgrade step following this.
// Moodle v2.6.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2013112100) {
// Set customint1 (group enrolment key) to 0 if it was not set (null).
$DB->execute("UPDATE {enrol} SET customint1 = 0 WHERE enrol = 'self' AND customint1 IS NULL");
upgrade_plugin_savepoint(true, 2013112100, 'enrol', 'self');
}
return true;
}

View File

@ -24,7 +24,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2013110500; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2013112100; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2013110500; // Requires this Moodle version
$plugin->component = 'enrol_self'; // Full name of the plugin (used for diagnostics)
$plugin->cron = 600;