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

Importing Grades via CSV with blank or whitespace as useridnumber

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.3, 2.6.1
    • Fix Version/s: 2.5.5, 2.6.2
    • Component/s: Gradebook
    • Labels:
    • Testing Instructions:
      Hide

      Export your courses grades to a CSV file. Modify the CSV file to include a row with an idnumber of " " like the example John Doe in the included switlik-test1_Grades.csv file.

      Try to import the modified file based on ID number.

      You should receive an error saying 'user mapping error, could not find user with idnumber ""'.

      Show
      Export your courses grades to a CSV file. Modify the CSV file to include a row with an idnumber of " " like the example John Doe in the included switlik-test1_Grades.csv file. Try to import the modified file based on ID number. You should receive an error saying 'user mapping error, could not find user with idnumber ""'.
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-42618_master

      Description

      If a CSV file contains a row with a "ID number" set to a whitespace or blank. If you have deleted users in the system. It may cause a crash that leaves abandoned records in the grade_import_values and grade_import_newitem tables.

      Deleted users have a idnumber of "" in Moodle. At least they do in Moodle running on PostgreSQL as the DB.

      The import csv code checks if the user exists by doing a get_record() based solely on idnumber. It should handle a value of "" correctly and abort the import.

      The system will declare "Grade import success" with the following:
      This import included the following grades for users not currently enrolled in this course:
      User [DELETED USER] () on item

      If the system has a lot of deleted users the system may crash do to memory exhaustion. The example switlik-test1_Grades.csv file crashed my development server with a 3.5GB max memory setting but not on our production system with 4GB max memory set.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Mar/14