Opened 11 years ago
Closed 11 years ago
#11307 closed Bug (fixed)
Paste as plain text broken when Mootools is loaded (Array's prototype contains $constructor)
Reported by: | edwtests | Owned by: | Piotrek Koszuliński |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.3.2 |
Component: | Core : Pasting | Version: | 4.0 Beta |
Keywords: | Cc: |
Description (last modified by )
1) Extract CKEditor full
2) Use the following settings:
CKEDITOR.editorConfig = function(config) { config.allowedContent = true; };
3) Open a page with CKEditor in it.
4) Use the paste as plain text button, and paste rich text from a webpage. For example, I copied the side bar content at http://msdn.microsoft.com/en-us/library/aa288454%28v=vs.71%29.aspx
5) The text is not inserted.
See screenshot. PS: Tried with version 4.3.1 too, no change.
Short TC
- Download 11307.html to
samples/
. - Follow instructions.
Attachments (6)
Change History (18)
Changed 11 years ago by
comment:1 Changed 11 years ago by
(Sorry, I messed up the WikiFormat on the original ticket, it was my first one)
1) Extract CKEditor full
2) Use the following settings:
CKEDITOR.editorConfig = function(config) {
config.allowedContent = true;
};
3) Open a page with CKEditor in it.
4) Use the paste as plain text button, and paste rich text from a webpage. For example, I copied the side bar content at http://msdn.microsoft.com/en-us/library/aa288454%28v=vs.71%29.aspx
5) The text is not inserted.
See screenshot. PS: Tried with version 4.3.1 too, no change.
comment:2 Changed 11 years ago by
Description: | modified (diff) |
---|
Changed 11 years ago by
comment:3 Changed 11 years ago by
Keywords: | paste plain text allowedContent removed |
---|---|
Status: | new → pending |
comment:4 Changed 11 years ago by
Just attached screenshots of the consoles. On IE11 the popup to enter the text doesn't even appear, the text is pasted directly, but the error is still there.
All tests on Win7 Pro x64 Firefox 26 Chrome 32 IE11
comment:5 Changed 11 years ago by
Hello again. I have traced this down to an incompatibility with "mootools-core-1.3.1-full-compat-yc.js", which was being loaded by a base page.
You may want to close this ticket now, thanks.
Just FYI, I downloaded the uncompressed CKEditor pack and found the line with the conflict: ckeditor\core\htmlparser\filter.js:230.
if ( rulesGroup ) return rulesGroup.exec( context, value, element, this );
I changed it to
if ( rulesGroup && typeof(rulesGroup.exec) == "function" ) return rulesGroup.exec( context, value, element, this );
and now the feature works correctly. I have no idea which other features are affected by mootools; will try to post back if I find any.
Regards
comment:6 Changed 11 years ago by
Status: | pending → confirmed |
---|---|
Version: | 4.3 → 4.0 Beta |
This incompatibility turned out to be caused by issue in CKEditor. It took a while to figure out why element.attributes
becomes a reference to Object
constructor, but I managed to locate this.
https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/clipboard/plugin.js#L1096
Attributes are set to an array, but they should be an object. Most likely then some code starts iterating over that array and weird things happen.
comment:7 Changed 11 years ago by
Owner: | set to Piotrek Koszuliński |
---|---|
Status: | confirmed → assigned |
comment:8 Changed 11 years ago by
Milestone: | → CKEditor 4.3.2 |
---|---|
Status: | assigned → review |
Pushed t/11307 on dev and tests.
comment:9 Changed 11 years ago by
Description: | modified (diff) |
---|---|
Summary: | Paste as plain text broken when "config.allowedContent = true" → Paste as plain text broken when Mootools is loaded (Array's prototype contains $constructor) |
Changed 11 years ago by
Attachment: | 11307.html added |
---|
comment:12 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed on master with git:feba862 on dev and 60f0e27 on tests.
Screenshot