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

Cannot edit broken image in TinyMCE

XMLWordPrintable

    • MOODLE_404_STABLE
    • MOODLE_404_STABLE
    • MDL-82718-404
    • Hide
      1. Log in as admin
      2. Ensure TinyMCE is your preferred editor
      3. Edit your profile
      4. In the Description field, view the editor source and enter the following:

        <p><img src="http://example.com/blah.jpg" alt="" width="120" height="120"></p>
        

      5. Back in the editor, click on the image element then press the Image icon from the toolbar
      6. Confirm you see a dialogue with the following message

        An image must have a valid URL.
        

      7. Confirm there are no errors in your browser console
      Show
      Log in as admin Ensure TinyMCE is your preferred editor Edit your profile In the Description field, view the editor source and enter the following: <p><img src="http://example.com/blah.jpg" alt="" width="120" height="120"></p> Back in the editor, click on the image element then press the Image icon from the toolbar Confirm you see a dialogue with the following message An image must have a valid URL. Confirm there are no errors in your browser console

      If you try to edit an image that has a broken url in TinyMCE you get the following JS error:

      TypeError: Cannot read properties of undefined (reading 'imageurlrequired')

       

       

      I checked this on Moodle 4.4 and on the https://school.moodledemo.net/ site and the issue is present there, too.

       

      Steps to reproduce:

      1. Add an image using the TinyMCE editor.
      2. Using View > Source code, edit the image src to a broken link.
      3. Save and go back to the TinyMCE editor.
      4. Click on the broken image, and click on the Image button in the Editor toolbar, to update the image.
      5. You will see "Preparing the image" in the dialog but it never completes.
      6. In the Devtools of the browser, you see the JS error provided above.

            pholden Paul Holden
            rjnl Rajneel Totaram
            Stevani Andolo Stevani Andolo
            Huong Nguyen Huong Nguyen
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 8 minutes
                1h 8m

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