Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-28253

Upgrade to 2.x fails if a role called "Manager" exists

    XMLWordPrintable

    Details

    • Database:
      Any
    • Testing Instructions:
      Hide

      Create a role with the name "Manager" in Moodle 1.9.
      Attempt to upgrade to Moodle 2.x.
      During the System section of the upgrade script, it will crash with a database error due to the non-unique value.

      Repeat the above with "manager" in short name.

      Show
      Create a role with the name "Manager" in Moodle 1.9. Attempt to upgrade to Moodle 2.x. During the System section of the upgrade script, it will crash with a database error due to the non-unique value. Repeat the above with "manager" in short name.
    • Workaround:
      Hide

      If you manually rename the Manager role that you have created to something else, the upgrade will work. However, there's currently nothing to tell you to do this.

      Show
      If you manually rename the Manager role that you have created to something else, the upgrade will work. However, there's currently nothing to tell you to do this.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w28_MDL-28253_m22_managerupgrade

      Description

      If you have created a role in Moodle 1.9 called "Manager", the upgrade to 2.x will fail as it will try and create a new role called "Manager", and the name field of the roles table must be unique.

      2 possible solutions would be:

      1. Leave the current "Manager" role in place and use it for 2.x's purposes (if that wouldn't cause problems), or
      2. Check for the existence of the "Manager" role at the start of the upgrade script, and tell the user they must rename it before the upgrade can continue.

      This issue has been discussed before, but not completely solved. See related issues.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                skodak Petr Skoda
                Reporter:
                marxjohnson Mark Johnson
                Integrator:
                Sam Hemelryk
                Tester:
                David Mudrák (@mudrd8mz)
                Participants:
                Component watchers:
                Matteo Scaramuccia, Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  1/Aug/11