You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
On the page mod/pdfannotator/view.php?id=31156&action=statistic (as an example), the graph statistic throws console errors (unknown yet if that affects anything). See the screenshot.
Going into the code, it originates in shared/statistics.js. See
The simple solution seems to be to change the scales config from an array of a single object to just a single object. At least this way the error vanishes from the console log.
Moodle Version in use
Moodle 4.1.13
** Plugin Version **
v1.5.4
Describe the bug
On the page mod/pdfannotator/view.php?id=31156&action=statistic (as an example), the graph statistic throws console errors (unknown yet if that affects anything). See the screenshot.
Going into the code, it originates in shared/statistics.js. See
moodle-mod_pdfannotator/shared/statistic.js
Lines 118 to 132 in bea2d65
The xAxes/yAxes scales configuration used to call Moodle's chartjs library is an array of a single object. Moodle's chartjs library validates the scales config to ensure it's an object, see https://github.com/moodle/moodle/blob/ab5692acdf1f9a2b3cf06986f49b951558793f38/lib/amd/src/chartjs-lazy.js#L7282-L7289. (master, Moodle 4.1.13 is the same).
The simple solution seems to be to change the scales config from an array of a single object to just a single object. At least this way the error vanishes from the console log.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No console error. As the scale config is ignored, there should probably be differences in the scales.
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: