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

Grader Report JS error

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.7.9, 2.8.7, 3.0
    • None
    • Gradebook, JavaScript
    • MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_30_STABLE
    • MDL-51329_master
    • Hide

      Keep grade_report_enableajax off.

      Show
      Keep grade_report_enableajax off.
    • Hide

      Create a gradebook with any number of items or categories.
      Open console where the errors will be logged by the browser.
      Make these settings: grade_report_enableajax: "off", grade_overridecat: "on".
      Navigate to grader report with editing off.
      Note no errors and floating headers appear
      Turn editing on.
      Note no errors and floating headers appear
      Change grade_overridecat to "off".
      Navigate to grader report with editing turned off.
      Note no errors and floating headers appear
      Turn editing on.
      Note no errors and floating headers appear
      Change grade_report_enableajax to "on".
      Navigate to grader report with editing turned off.
      Note no errors and floating headers appear
      Turn editing on.
      Error: JS error logged and no floating headers appear.
      Expected: No errors and floating headers appear
      Change the course total.
      Note no errors appear

      Show
      Create a gradebook with any number of items or categories. Open console where the errors will be logged by the browser. Make these settings: grade_report_enableajax: "off", grade_overridecat: "on". Navigate to grader report with editing off. Note no errors and floating headers appear Turn editing on. Note no errors and floating headers appear Change grade_overridecat to "off". Navigate to grader report with editing turned off. Note no errors and floating headers appear Turn editing on. Note no errors and floating headers appear Change grade_report_enableajax to "on". Navigate to grader report with editing turned off. Note no errors and floating headers appear Turn editing on. Error: JS error logged and no floating headers appear. Expected: No errors and floating headers appear Change the course total. Note no errors appear

    Description

      When editing is turned on as well as admin setting grade_report_enableajax and admin setting grade_overridecat is turned off, line 612 of grade/report/grader/module.js will cause an uncaught JS error that stops all JS on the page.

      612 this.grade.on('blur', this.submit, this);

      I have found that this is occurring because this.grade is targeting a null node:

      598 this.grade = this.report.Y.one('#grade_'userid'_'+itemid);

      If grade_overridecat is set to "off", then the itemid is targeting a category grade input that does not exist. Therefore, an error is thrown, JS stops, and features using JS (such as floating headers) do not function.

      If AJAX or editing is turned off, the JS functions containing these operations are not called.

      Attachments

        Issue Links

          Activity

            People

              jinhofer Joseph Inhofer
              jinhofer Joseph Inhofer
              Adrian Greeve Adrian Greeve
              Dan Poltawski Dan Poltawski
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Sujith Haridasan, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: