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

Atto JavaScript error dragging images when maxfiles is 0

XMLWordPrintable

    • 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.

      1. As an admin:
        1. Create a course.
        2. Enrol a student.
        3. Add a quiz.
        4. Add an essay question to the quiz with Response format: "HTML editor" (not "HTML editor with file picker").
      2. Log in as the student.
        1. Go to the student's preferences page, click Editor preferences and change Text editor to "Atto HTML editor".
        2. Go to the course.
        3. Click on the quiz and attempt it.
        4. Download an image.
        5. 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.

            Unassigned Unassigned
            leonstr Leon Stringer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.