Skip to content

Commit

Permalink
MSFTMPP-299: Fix upgrade step to only run if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmcq committed Dec 1, 2015
1 parent fe7e907 commit c0c0616
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions local/o365/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,16 +303,19 @@ function xmldb_local_o365_upgrade($oldversion) {
}

if ($result && $oldversion < 2015011636.01) {
$fieldmapdefault = [
'givenName/firstname/always',
'surname/lastname/always',
'mail/email/always',
'city/city/always',
'country/country/always',
'department/department/always',
'preferredLanguage/lang/always',
];
set_config('fieldmap', serialize($fieldmapdefault), 'local_o365');
$fieldmapconfig = $DB->get_record('config_plugins', ['plugin' => 'local_o365', 'name' => 'fieldmap']);
if (empty($fieldmapconfig)) {
$fieldmapdefault = [
'givenName/firstname/always',
'surname/lastname/always',
'mail/email/always',
'city/city/always',
'country/country/always',
'department/department/always',
'preferredLanguage/lang/always',
];
set_config('fieldmap', serialize($fieldmapdefault), 'local_o365');
}
upgrade_plugin_savepoint($result, '2015011636.01', 'local', 'o365');
}

Expand Down

0 comments on commit c0c0616

Please sign in to comment.