Permalink
Browse files

Merge branch 'w28_MDL-28253_m20_managerupgrade' of git://github.com/s…

…kodak/moodle into MOODLE_20_STABLE
  • Loading branch information...
2 parents 78092d6 + badddca commit 45222fc50f71d318ffb3ca339d0180b0de982ec3 @samhemelryk samhemelryk committed Jul 18, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/db/upgrade.php
View
@@ -2858,16 +2858,16 @@ function xmldb_main_upgrade($oldversion) {
unset($role->capability);
if ($role->archetype === 'admin') {
$i = '';
- if ($DB->record_exists('role', array('shortname'=>'manager'))) {
+ if ($DB->record_exists('role', array('shortname'=>'manager')) or $DB->record_exists('role', array('name'=>get_string('manager', 'role')))) {
$i = 2;
- while($DB->record_exists('role', array('shortname'=>'manager'.$i))) {
+ while($DB->record_exists('role', array('shortname'=>'manager'.$i)) or $DB->record_exists('role', array('name'=>get_string('manager', 'role').$i))) {
$i++;
}
}
$role->archetype = 'manager';
if ($role->shortname === 'admin') {
$role->shortname = 'manager'.$i;
- $role->name = get_string('manager', 'role');
+ $role->name = get_string('manager', 'role').$i;
$role->description = get_string('managerdescription', 'role');
}
}

0 comments on commit 45222fc

Please sign in to comment.