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

Importing groups with coursename results in error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.4.4, 3.2.6, 3.3.3, 3.4
    • Fix Version/s: None
    • Component/s: Groups
    • Labels:
    • Testing Instructions:
      Hide

      1. Create a course and set its shortname to "test"
      2. Create a csv file with the following content:

      coursename,groupname,description
      test,TestGroup2,This is a test group
      

      3. Enter the course you created at step 1 and go to users > groups page.
      4. Click on the "Import group" button and import the file created at step 2.
      5. The group should be imported successfully.

      Show
      1. Create a course and set its shortname to "test" 2. Create a csv file with the following content: coursename,groupname,description test,TestGroup2,This is a test group 3. Enter the course you created at step 1 and go to users > groups page. 4. Click on the "Import group" button and import the file created at step 2. 5. The group should be imported successfully.
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE

      Description

      I have a course with a shortname of "test" and an idnumber of "test" - when trying to import a group using the following in a csv file:

      coursename,groupname,description
      test,TestGroup2,This is a test group

      I get this error:

      Field "0" does not exist in table "course"

      More information about this error
      Debug info:
      Error code: ddlfieldnotexist
      Stack trace:

      line 545 of /lib/dml/moodle_database.php: dml_exception thrown
      line 1332 of /lib/dml/moodle_database.php: call to moodle_database->where_clause()
      line 148 of /group/import.php: call to moodle_database->get_record()

      However, if I change the .csv to this:

      idnumber,groupname,description
      test,TestGroup2,This is a test group

      the group imports successfully. Perhaps courseid is not being set when using coursename?

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: