-
Bug
-
Resolution: Won't Fix
-
Minor
-
None
-
4.1.9, 4.2.5, 4.3.3
-
MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE
If an Atto instance's maxfiles is 0 you can still drag and drop or paste images. Doing so results in a JavaScript error in the console. The exact error depends on the browser, with Firefox it's Uncaught TypeError: options is undefined in Chromium it's Uncaught TypeError: Cannot read properties of undefined (reading 'savepath'). If buttons were disabled at the start of the operation they remain disabled.
I can reproduce this with:
- Drag and drop image file:
- On Fedora 37 Linux with Gnome Files 4.34 and Firefox 120.0.1
- On Fedora 37 Linux with Gnome Files 4.34 and Chromium 120.0.6099.199.
-
- On Microsoft Windows 10 with Firefox 121.0.1
- Paste image:
- On Fedora 37 Linux with Firefox 120.0.1
- On Microsoft Windows 10 with Firefox 121.0.1
Steps to reproduce issue
This is one scenario showing this problem.
- As an admin:
- Create a course.
- Enrol a student.
- Add a quiz.
- Add an essay question to the quiz with Response format: "HTML editor" (not "HTML editor with file picker").
- Log in as the student.
- Go to the student's preferences page, click Editor preferences and change Text editor to "Atto HTML editor".
- Go to the course.
- Click on the quiz and attempt it.
- Download an image.
- Drag the image from a file manager window into the Atto field.
Expected results
Presumably the drag-and-drop should not be permitted if maxfiles is 0, so nothing should happen.
Actual results
The Finish attempt ... button is disabled. The browser console contains a JavaScript error.