Throws an error, TypeError: Cannot read property 'isBlock' of undefined
}}}
--
Ticket URL: <http://dev.ckeditor.com/ticket/10339>
CKEditor <http://ckeditor.com/>
The text editor for the Internet
* version: => 4.1
Comment:
I have the same error if I try to insert an image tag to the editor with
CKeditor 4.1 (or the latest nightly build).
If I run the code (insertHtml function):
{{{
CKEDITOR.instances[edit-field-body-und-0-value].insertHtml('<img
src="/sites/default/files/styles/thumbnail/public/wysiwyg/images/bildschirmfoto_2012-09-28_um_12.34.44.png?itok=wMgqD_Pg"
width="100" height="48" alt="" class="image-thumbnail" />');
or
CKEDITOR.instances['edit-field-body-und-0-value'].insertHtml('<img
src="/sites/default/files/styles/thumbnail/public/wysiwyg/images/bildschirmfoto_2012-09-28_um_12.34.44.png?itok=wMgqD_Pg"
width="100" height="48" alt="" class="image-thumbnail" />');
}}}
The error message:
{{{
Uncaught TypeError: Cannot read property 'isBlock' of undefined
ckeditor.js:320
d ckeditor.js:320
i ckeditor.js:320
(anonymous function) ckeditor.js:325
CKEDITOR.editable.CKEDITOR.tools.createClass.proto.insertHtml
ckeditor.js:300
(anonymous function) ckeditor.js:306
j ckeditor.js:10
CKEDITOR.event.CKEDITOR.event.fire ckeditor.js:12
CKEDITOR.editor.CKEDITOR.editor.fire ckeditor.js:13
CKEDITOR.tools.extend.insertHtml ckeditor.js:226
Drupal.insert.insertIntoActiveEditor insert.js:168
insert insert.js:106
c.event.handle jquery.js:64
h.handle.o
}}}
--
Ticket URL: <http://dev.ckeditor.com/ticket/10339#comment:1>
* status: new => confirmed
Comment:
Yep, I confirm this too. But to reproduce this I had to check it on basic
preset (where image is not allowed).
--
Ticket URL: <http://dev.ckeditor.com/ticket/10339#comment:2>
* priority: Normal => High
Comment:
Issue exists because insertHtml is not prepared that during filtering data
my be completely emptied. It checks data string at the beginning, but does
not repeat this after passing them through the filter.
Unfortunately it's a little bit too late to schedule this ticket for
4.1.1, so we'll fix it in next release.
--
Ticket URL: <http://dev.ckeditor.com/ticket/10339#comment:3>
Comment (by cbeier):
I think the problem is related to the Advanced Content Filter. If I
deactivate the filter (config.allowedContent = true;) all works.
--
Ticket URL: <http://dev.ckeditor.com/ticket/10339#comment:4>
Comment (by Reinmar):
Yes, usually it is caused by ACF - that's what I meant by "passing them
through the filter". But parser and data processor (which are used
together with filter) may also strip some data in specific situations, so
this is not only related to ACF.
--
Ticket URL: <http://dev.ckeditor.com/ticket/10339#comment:5>
* milestone: => CKEditor 4.1.2
--
Ticket URL: <http://dev.ckeditor.com/ticket/10339#comment:6>
* owner: => a.nowodzinski
* status: confirmed => assigned
--
Ticket URL: <http://dev.ckeditor.com/ticket/10339#comment:7>
* status: assigned => review
Comment:
DEV: Created fix in [https://github.com/cksource/ckeditor-
dev/commits/t/10339 t/10339 branch].
branch
TESTS: Added basic test to insertHtml and mt for the ticket.
--
Ticket URL: <http://dev.ckeditor.com/ticket/10339#comment:8>
* status: review => review_passed
Comment:
I pushed additional test (it's always good to include ticket's tc) and
minor fix for dev.
--
Ticket URL: <http://dev.ckeditor.com/ticket/10339#comment:9>
* status: review_passed => closed
* resolution: => fixed
Comment:
Merged fix into master, dev git:7a702d809ddd8, tests: b5db5e71750e8.
--
Ticket URL: <http://dev.ckeditor.com/ticket/10339#comment:10>