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

Grader Report JS error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.7.9, 2.8.7, 3.0
    • Fix Version/s: None
    • Component/s: Gradebook, JavaScript
    • Labels:
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-51329_master
    • Workaround:
      Hide

      Keep grade_report_enableajax off.

      Show
      Keep grade_report_enableajax off.
    • Testing Instructions:
      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

              Assignee:
              jinhofer Joseph Inhofer
              Reporter:
              jinhofer Joseph Inhofer
              Peer reviewer:
              Adrian Greeve Adrian Greeve
              Integrator:
              Dan Poltawski Dan Poltawski
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: