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

Restoring course with groups with duplicate names database write error.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6.9
    • Fix Version/s: None
    • Component/s: Assignment, Backup, Groups
    • Labels:
      None
    • Affected Branches:
      MOODLE_36_STABLE

      Description

      It is possible to create 2 groups with the same name in the same course if they use different case. For exemple we could have the groups "Uber" and "UBER". Then in a course that has such groups we can add an instance of the module mod_assign. The students of the course do their assignment and then the couse is backuped.

       

      If we try to restore the course there will be a database write error on the table mdl_assign_submission because of a duplicate entry on a key made of the fields assignment, userid, groupid and attemptnumber, the error being on the groupid field. What I think is happening is that since we have 2 groups that have similar names, the groupid we get for the 2 groups will be the same and will cause a duplicate entry.

       

      The database write error happen in the function process_assign_submission but the problem may be the groupid returned by the function get_mappingid('group', $data->groupid). As I said at this point the groupid returned will be the same for the 2 differents groups.

       

      Perhaps there is something to be fixed in the way get_mappingid works so that it return the right groupid when many groups have names differing only by the case.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            jfrouleau Jean-François Rouleau
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: