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

Contenteditable areas process pasted images (blob image) but they are not saved to a filearea

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor Minor
    • None
    • 3.5
    • Text editor Atto
    • None
    • MOODLE_35_STABLE

      Hi,
      a user of us came up with this problem. He copied and pasted a chart from an Excel file and pasted it to the feedback as comment area of an assignment. The image is displayed there. He saved this and still saw the image. Then he contacted us because the user cannot see this image when he opens his assignment and has a look at the feedback.

      The cause is that this image preview is processed by the browser and a blob src url is created. However this image is never been saved to a file area on the server from where this image could be restored. However the user thinks that everything worked correctly as he did not get an error message and if he comes back to that editor within the same session, he still sees the image correctly.

      We think that this case should be handled, because the user cannot assume that something won't be processed at this place. This could be either by saving those images to the server (better way) or by not displaying those images in the editor (ideally with a short error message).

      Steps to reproduce:

      1. Login as a teacher
      2. Go to one of your courses and turn editing on
      3. Add a label to the course
      4. Open the attached Excel file
      5. Copy the chart from the Excel file
      6. Paste the image to the text area in Moodle
      7. See that the chart is displayed correctly as an image
      8. Go to the web inspector and take a look at this image file
      9. See that the img src url looks like this blob:https://your.moodle.com/e767202d-d697-423e-9740-cc82f9d368f9 (the code is uniquely generated and it won't be the same as in this example)
      10. Save the changes to your label
      11. See that the image is displayed correctly in the course
      12. Logut, empty the cache and login again
      13. Go back to the course
      14. See that the image is broken now

      Hint:
      You can try to paste the chart into this Jfiddle to see that the processing of a pasted image into a blob url is done by default for contenteditable divs: https://jsfiddle.net/t0bj8gy7/

      Maybe this issue could be declared as a bug but I was unsure, so I decided for improvement.

      Best, Kathrin

            Unassigned Unassigned
            kosswa Kathrin Osswald
            Votes:
            5 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

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