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

Duplicating an activity will occasionally duplicate some groups in a course

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 2.2.1, 3.5, 3.5.2
    • Backup
    • MOODLE_22_STABLE, MOODLE_35_STABLE

      After duplicating an activity in a course, some groups in that course are duplicated.

      Investigation showed that this is basically happening because the teacher who сreated the groups which are duplicating, presumably did not type the descriptions in Moodle, but copypasted them from an office app, such as MS Word.

      When duplicating activity, Moodle actually backs it up, including groups, and then restores it as a new copy. Each group from backup is checked if it already exists in the course and if not, it's (re-)created. To do the check, Moodle searches for groups which names AND descriptions exactly match those in backup. See restore_stepslib.php, function process_group().

      If group description is pasted from MS Word, it may contain character sequences 0D 0A (\r\n) which are sanitized somewhere on backup being converted to a single byte character 0A (\n), hence group description in backup will not strictly match that in the database and the group will duplicate.

      Attaching 2 files:
      1. desc-db.txt — description of a group containing special characters, retrieved from the database.
      2. groups.xml — groups file from course backup.

        1. desc-db.txt
          0.1 kB
          Kirill Astashov
        2. groups.xml
          2 kB
          Kirill Astashov
        3. MDL-33176-immediate-fix.diff
          1 kB
          Kirill Astashov

            mhughes2k Michael Hughes
            badblock Kirill Astashov
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.