Merge branch 'MDL-42772-master' of git://github.com/FMCorz/moodle

This commit is contained in:
Damyon Wiese 2013-11-08 16:15:17 +08:00
commit e3552170da
2 changed files with 17 additions and 1 deletions

View File

@ -2831,5 +2831,21 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2013110600.01);
}
if ($oldversion < 2013110600.02) {
// If the user is logged in, we ensure that the alternate name fields are present
// in the session. It will not be the case when upgrading from 2.5 downwards.
if (!empty($USER->id)) {
$refreshuser = $DB->get_record('user', array('id' => $USER->id));
$fields = array('firstnamephonetic', 'lastnamephonetic', 'middlename', 'alternatename', 'firstname', 'lastname');
foreach ($fields as $field) {
$USER->{$field} = $refreshuser->{$field};
}
}
// Main savepoint reached.
upgrade_main_savepoint(true, 2013110600.02);
}
return true;
}

View File

@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2013110600.01; // YYYYMMDD = weekly release date of this DEV branch.
$version = 2013110600.02; // YYYYMMDD = weekly release date of this DEV branch.
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.