Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-5788

Image copy & paste in richtext editor throws a JS error

    XMLWordPrintable

Details

    • Yes

    Description

      It throws a JS error when I copy and paste an image inside the richtext editor in Ibexa 4.5.0.

      I also have Ibexa 4.4.1 installation where it works and there's no error.

       

      To reproduce the problem:

      1. Create/edit a content that have a richtext attribute
      2. In the richtext toolbar use Image Embed and embed some image
      3. Select image in the richtext editor, copy and paste it

      Result: Image is not pasted and we get an error in the javascript console

       

      The error is thrown in the fieldtype-richtext bundle in the file `src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-editing.js` at line 174.

      The object `link` doesn't have a function `getAttribute` so it fails trying to execute this line

      upcastWriter.setAttribute('ibexaLinkHref', link.getAttribute('href'), modelElement);

      When I change the condition at line 173 to

      if (link && link.getAttribute) {

      then copy & paste of an image works fine and there's no error.

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              e36b8d7e-ac7b-4a9f-87d9-0c1a1a3f8db1@accounts.ibexa.co Pawel Goca
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: