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

Ticking Manual Completion Box Before Page Loads Results in Errors

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_35_STABLE

      Description

      Steps to reproduce
      ===============

      1. Enable Completion Tracking in a course's settings.
      2. Add an Activity (i.e. Page) and enable Activity Completion: Students can manually mark the activity as completed.
      3. Turn off course editing so you can tick the checkbox.
      4. Refresh the page with the keyboard (i.e. Ctrl-R) and try to click the checkbox right before the page finishes loading (before the checkbox image even loads). You may have to click multiple times if the site loads fast. Eventually, the page will reload by itself again and you will see the error in the browser console (Firefox, Chrome).

      Actual result
      ==========

      Behavior:

      • The page reloads itself.
      • The course completion tick mark is toggled OK, but the errors below show in the console.

      Firefox 63.0, one or more of these errors:

      • Error: Script error for "core/first"
        http://requirejs.org/docs/errors.html#scripterror     require.js:41:53
      • TypeError: M.core_completion is undefined [Learn More]     view.php:1323:84
      • TypeError: M.filter_mathjaxloader is undefined
      • Page unloaded.

       
      Chrome 70.0.3538.110:

      • Uncaught TypeError: Cannot read property 'parentNode' of null
        at Y_Node.DEFAULT_GETTER (yui_combo.php?rollup/3.17.2/yui-moodlesimple.js:17470) yui_combo.php?rollup/3.17.2/yui-moodlesimple.js:17470

      Expected result
      ============

      The tick mark should toggle on/off as normal with no errors or reloading of the page.

      Other points
      ==========

      It is easier to reproduce on slow-loading sites, but still possible on demo.moodle.net

      Possibly related issue: https://tracker.moodle.org/browse/MDL-54581

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nyanginator Nicholas Yang
              Participants:
              Component watchers:
              Sam Marshall, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón, Jake Dallimore, Jun Pataleta, Ryan Wyllie
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: