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

Import Groups from CSV throws various notices and confusing errors

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.2, 2.7.2, 2.8, 2.9.5, 3.0.3, 3.3.3, 3.4
    • Fix Version/s: 3.3.4, 3.4.1
    • Component/s: Groups
    • Testing Instructions:
      Hide
      1. Create two courses with shortnames Course1, Course2 and idnumbers C1, C2 respectively
      2. Create a .csv file with several groups following docs here: https://docs.moodle.org/33/en/Import_groups
      3. Login as admin/manager , go to one of the courses and open Participants > Groups > Import groups
      4. Import the file and make sure that everything is imported where it was supposed to be and there were no PHP notices or errors
      5. Repeat for a different csv file

      There were number of bugs in the group import code, here are some examples of CSV files but try to be creative and test different combinations (see commit message for the list of bugs fixed):

      groupname
      group1
      group2
      

      idnumber,groupname
      C1,group3
      C-non-existing,group-will-not-be-created
      C1,group4
      C2,group5
      ,group6
      

      coursename,groupname
      Course1,group7
      C-non-existing,group-will-not-be-created
      Course1,group8
      Course2,group9
      ,group10
      

      groupname,groupidnumber
      group11,G11
      group12,G12
      

      Show
      Create two courses with shortnames Course1, Course2 and idnumbers C1, C2 respectively Create a .csv file with several groups following docs here: https://docs.moodle.org/33/en/Import_groups Login as admin/manager , go to one of the courses and open Participants > Groups > Import groups Import the file and make sure that everything is imported where it was supposed to be and there were no PHP notices or errors Repeat for a different csv file There were number of bugs in the group import code, here are some examples of CSV files but try to be creative and test different combinations (see commit message for the list of bugs fixed): groupname group1 group2 idnumber,groupname C1,group3 C-non-existing,group-will-not-be-created C1,group4 C2,group5 ,group6 coursename,groupname Course1,group7 C-non-existing,group-will-not-be-created Course1,group8 Course2,group9 ,group10 groupname,groupidnumber group11,G11 group12,G12
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull Master Branch:
      wip-MDL-45068-master

      Description

      I have a CSV file as:

      coursename, groupname, idnumber, lang, enrolmentkey
      course1, group1, c1, bg, ccc
      course1, group2, c1, bg, ccc

      The idnumber should be the id number of the course. When importing group1 is created in course1 and group1 is assigned an ID of c1. Then group2 can no longer be imported since there is already a group with idnumber c1.

      In the same time c1 should be the course number.

      This meas one can not import more than one group in a course.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                9 Vote for this issue
                Watchers:
                14 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  15/Jan/18