Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-40467

GradebookNG > Import > Avoid NPE if user missing from site and "Student Name" cell is empty

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Verified
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 12.3
    • Fix Version/s: 12.4, 19.0
    • Component/s: Gradebook
    • Labels:
      None
    • 12 status:
      Resolved
    • Test Plan:
      Hide
      1. Export the gradebook to a CSV file
      2. Edit the CSV file
      3. Change any row's first cell to a user ID which is not a member of your site (just make up a username that you know doesn't exist in the system)
      4. For the edited row, remove any value from the "Student Name" cell
      5. Import the CSV file
      6. If you are presented with a bug report, stack trace, or error number, the issue is not fixed
      7. If you are presented with the next step in the wizard, and you can see the relevant bogus entry in the respective panel, the issue is fixed
      Show
      Export the gradebook to a CSV file Edit the CSV file Change any row's first cell to a user ID which is not a member of your site (just make up a username that you know doesn't exist in the system) For the edited row, remove any value from the "Student Name" cell Import the CSV file If you are presented with a bug report, stack trace, or error number, the issue is not fixed If you are presented with the next step in the wizard, and you can see the relevant bogus entry in the respective panel, the issue is fixed

      Description

      When importing a spreadsheet in GradebookNG, if a row contains a user ID which is not a member of the site AND the row contains a null value for the "Student Name" cell, an NPE will be generated.

      This is caused by the reporting algorithm which is responsible for telling the user which entries in the file belong to users who are not members of the site. This algorithm access the row's "Student Name" value and tries to call .trim() on it, which generates the NPE if the cell in the file has no value.

      The solution is simple: when setting this value, call StringUtils.trimToEmpty().

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  bjones86 Brian Jones
                  Reporter:
                  bjones86 Brian Jones
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code