Skip to content

Commit

Permalink
Merge branch 'w28_MDL-28253_m22_managerupgrade' of git://github.com/s…
Browse files Browse the repository at this point in the history
…kodak/moodle
  • Loading branch information
samhemelryk committed Jul 18, 2011
2 parents 50a3053 + dfe42f0 commit b96fa1c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
Expand Down

0 comments on commit b96fa1c

Please sign in to comment.