Opened 9 years ago
Last modified 9 years ago
#13889 confirmed Bug
Error on drag/drop images in inline editor inside an iframe
Reported by: | Bernd Bäumler | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Editable | Version: | 4.5.0 |
Keywords: | Cc: |
Description
Hi,
i have got a parent page which loads the ckeditor script and has an iframe in which the contenteditable divs are.
in this configuration, dargging and dropping an image gives an error:
TypeError: a is undefined: doc:a.document
line: extractHtmlFromRange:function(a,b){var c=w,d={range:a,doc:a.document}
the image is not moved, but sometimes "null" is inserted where the image should be.
my setup:
parent page with iframe id=ifr and the following code:
... load ckeditor ... <iframe id="ifr" src="iframe.php"></iframe>
$(document).ready(
function(){
var myFrame = document.getElementById('ifr'); ifr.onload=function(){
var contenteditableElement = myFrame.contentWindow.document.getElementById('editor1')
CKEDITOR.inline( contenteditableElement, {
removePlugins: 'maximize,resize'
} );
} onload ifr
});
iframe.php with <div id="editor1" contenteditable></div> and content
If I put the ckeditor script directly into iframe.php, everything works fine
best regards
Bernd
Attachments (2)
Change History (6)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Hi,
I put an example online:
http://www.bjb-media.at/test/ckeditor/test1.php
drag and drop the image will result in an error.
This bug was introduced with 4.5.0, with 4.4.8, everything worked fine.
comment:3 Changed 9 years ago by
Component: | General → Core : Editable |
---|---|
Keywords: | range added |
Changed 9 years ago by
Attachment: | mytest.html added |
---|
Changed 9 years ago by
Attachment: | mytest2.html added |
---|
comment:4 Changed 9 years ago by
Keywords: | range drag drop inline iframe removed |
---|---|
Status: | new → confirmed |
Version: | 4.5.4 → 4.5.0 |
Please see attached files.
When you try mytest2.html (native elements) than D&D in editable area or between areas, it works. When on the other hand you try mytesthtml.html with editors then you get errors:
- When you try D&D image in second editor, image ends up in firs editor.
- When you try D&D in first editor you are getting "Cannot read property 'document' of undefined" in editable.js, line:671. Firefox shows range is undefined, editable.js Line:1543.
- When you try to D&D from first editor to the second one, you get multiple "Error code: range-startcontainer" and "Cannot read property 'document' of undefined" in editable.js, line:671.
- When you try to D&D from second editor into first it works.
Correction:
The sample above works fine, without error. The error only occurs when you add a second inline editor:
var contenteditableElement2 = myFrame.contentWindow.document.getElementById('editor2')
var ed2 = CKEDITOR.inline( contenteditableElement2);
TypeError: range is undefined doc: range.document
in
extractHtmlFromRange: function( range, removeEmptyBlock ) {
in core/editable.js
thx
Bernd