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

Grader Report JS error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 2.7.9, 2.8.7, 3.0
    • 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

      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.

            jinhofer Joseph Inhofer
            jinhofer Joseph Inhofer
            Adrian Greeve Adrian Greeve
            Dan Poltawski Dan Poltawski
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.