-
Bug
-
Resolution: Fixed
-
Blocker
-
2.0
-
None
-
Any
-
MOODLE_20_STABLE
-
MOODLE_20_STABLE
-
Easy
When upgrading a site from moodle 1.9 to 2.0 I received the error:
Debug info: Duplicate entry 'manager' for key 4
UPDATE mdl_role SET name = ?,shortname = ?,description = ?,sortorder = ?,archetype = ? WHERE id=?
[array (
0 => 'Manager',
1 => 'manager',
2 => 'Managers can access course and modify them, they usually do not participate in courses.',
3 => '0',
4 => 'manager',
5 => '1',
)]
Stack trace:
- line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown
- line 922 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
- line 954 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
- line 2861 of /lib/db/upgrade.php: call to mysqli_native_moodle_database->update_record()
- line 1307 of /lib/upgradelib.php: call to xmldb_main_upgrade()
- line 261 of /admin/index.php: call to upgrade_core()
This is because the existing role table consisted of the following:
name | shortname
Administrator | admin
Course creator | coursecreator
Course Manager | manager
Course Co-ordinator | co-ordinator
Student | student
Guest | guest
Authenticated user | user
Suggestion: Check to see if the role name exists before updating, if so rename the existing role to a temporary name before proceeding.
- has been marked as being related by
-
MDL-28253 Upgrade to 2.x fails if a role called "Manager" exists
-
- Closed
-