Opened 8 years ago
Closed 8 years ago
#10339 closed Bug (fixed)
Error is thrown when inserting custom element
Reported by: | Piotrek Koszuliński | Owned by: | Olek Nowodziński |
---|---|---|---|
Priority: | Must have (possibly next milestone) | Milestone: | CKEditor 4.1.2 |
Component: | General | Version: | 4.1 |
Keywords: | Cc: |
Description
var currentDialog = CKEDITOR.dialog.getCurrent(); currentDialog._.editor.insertHtml("<customTag myAttr='var'></customTag>"); Throws an error, TypeError: Cannot read property 'isBlock' of undefined
Change History (10)
comment:1 Changed 8 years ago by
Version: | → 4.1 |
---|
comment:2 Changed 8 years ago by
Status: | new → confirmed |
---|
Yep, I confirm this too. But to reproduce this I had to check it on basic preset (where image is not allowed).
comment:3 Changed 8 years ago by
Priority: | Normal → High |
---|
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.
comment:4 Changed 8 years ago by
I think the problem is related to the Advanced Content Filter. If I deactivate the filter (config.allowedContent = true;) all works.
comment:5 Changed 8 years ago by
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.
comment:6 Changed 8 years ago by
Milestone: | → CKEditor 4.1.2 |
---|
comment:7 Changed 8 years ago by
Owner: | set to Olek Nowodziński |
---|---|
Status: | confirmed → assigned |
comment:8 Changed 8 years ago by
Status: | assigned → review |
---|
DEV: Created fix in t/10339 branch.
TESTS: Added basic test to insertHtml and mt for the ticket.
comment:9 Changed 8 years ago by
Status: | review → review_passed |
---|
I pushed additional test (it's always good to include ticket's tc) and minor fix for dev.
comment:10 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Merged fix into master, dev git:7a702d809ddd8, tests: b5db5e71750e8.
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):
The error message: