Details
-
Bug
-
Resolution: Fixed
-
Medium
-
4.5.0, 4.4.3
-
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:
- Create/edit a content that have a richtext attribute
- In the richtext toolbar use Image Embed and embed some image
- 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.