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

XML grade export fails for grade items with null ID numbers

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.9.9, 3.10.6, 3.11.2
    • Fix Version/s: 3.10.7, 3.11.3
    • Component/s: Gradebook
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a course
      2. Have at one student with an ID number enrolled in the course
      3. Have at another student without an ID number enrolled in the course
      4. Have a grade item with a null ID number (e.g. by creating a workshop activity)
      5. Go to Grades > Export > XML file
      6. Press Download
      7. Check the content of the XML file.
      8. Confirm that the XML gets downloaded correctly and no error is displayed.
      9. Confirm that the XML only contains an empty results element.
      10. Go to the grade book set up and add a manual grade item. Make sure this grade item has an ID number.
      11. Go to Grades > Export > XML file
      12. Press Download
      13. Check the content of the XML file.
      14. Confirm that the XML gets downloaded correctly.
      15. Confirm that the grade item that has no grade item has not been exported.
      16. Confirm that the manual grade item has been exported.
      17. Confirm that the grade exported belongs to the student with the ID number

       

      Show
      Create a course Have at one student with an ID number enrolled in the course Have at another student without an ID number enrolled in the course Have a grade item with a null ID number (e.g. by creating a workshop activity) Go to Grades > Export > XML file Press Download Check the content of the XML file. Confirm that the XML gets downloaded correctly and no error is displayed. Confirm that the XML only contains an empty results element. Go to the grade book set up and add a manual grade item . Make sure this grade item has an ID number. Go to Grades > Export > XML file Press Download Check the content of the XML file. Confirm that the XML gets downloaded correctly. Confirm that the grade item that has no grade item has not been exported. Confirm that the manual grade item has been exported. Confirm that the grade exported belongs to the student with the ID number  
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE
    • Pull 3.10 Branch:
      MDL-72257-310
    • Pull 3.11 Branch:
      MDL-72257-311
    • Pull Master Branch:

      Description

      To reproduce:

      1. Create a course
      2. Have at least one student with ID number enrolled in a course
      3. Have at least one grade item with null ID number (e.g. by creating a workshop activity)
      4. Go to Grades > Export > XML file
      5. Press download
      6. Expected: Grade export completes successfully.
      7. Actual: The following error occurs

        Exception - Argument 1 passed to grade_export_xml::xml_export_idnumber() must be of the type string, null given, called in [dirroot]/grade/export/xml/grade_export_xml.php on line 99
         
        More information about this error
         
        ×Debug info:
        Error code: generalexceptionmessage
        ×Stack trace:
        line 32 of /grade/export/xml/grade_export_xml.php: TypeError thrown
        line 99 of /grade/export/xml/grade_export_xml.php: call to grade_export_xml::xml_export_idnumber()
        line 61 of /grade/export/xml/export.php: call to grade_export_xml->print_grades()
        

        Attachments

        1. MDL-72257_Step 14-15.png
          MDL-72257_Step 14-15.png
          49 kB
        2. MDL-72257_Step 16-17.png
          MDL-72257_Step 16-17.png
          23 kB
        3. MDL-72257_Step 8.png
          MDL-72257_Step 8.png
          46 kB
        4. MDL-72257_Step 9.png
          MDL-72257_Step 9.png
          14 kB
        5. screenshot-1.png
          screenshot-1.png
          19 kB
        6. screenshot-2.png
          screenshot-2.png
          48 kB
        7. screenshot-3.png
          screenshot-3.png
          47 kB

          Issue Links

            Activity

              People

              Assignee:
              pholden Paul Holden
              Reporter:
              jpataleta Jun Pataleta
              Peer reviewer:
              Jun Pataleta Jun Pataleta
              Integrator:
              Sara Arjona (@sarjona) Sara Arjona (@sarjona)
              Tester:
              Angelia Dela Cruz Angelia Dela Cruz
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                13/Sep/21

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 10 minutes
                  2h 10m