Steps to reproduce
- Enable Completion Tracking in a course's settings.
- Add an Activity (i.e. Page) and enable Activity Completion: Students can manually mark the activity as completed.
- Turn off course editing so you can tick the checkbox.
- 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).
- 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"
- TypeError: M.core_completion is undefined [Learn More] view.php:1323:84
- TypeError: M.filter_mathjaxloader is undefined
- Page unloaded.
- 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
The tick mark should toggle on/off as normal with no errors or reloading of the page.
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