Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting data from nested editable with newly pasted widget inside throws an error #1469

Closed
Comandeer opened this issue Jan 17, 2018 · 2 comments · Fixed by #1484
Closed

Getting data from nested editable with newly pasted widget inside throws an error #1469

Comandeer opened this issue Jan 17, 2018 · 2 comments · Fixed by #1484
Assignees
Labels
plugin:widget The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. support:2 An issue reported by a commercially licensed client. target:major Any docs related issue that should be merged into a major branch. type:bug A bug.
Milestone

Comments

@Comandeer
Copy link
Member

Are you reporting a feature request or a bug?

Bug

Provide detailed reproduction steps (if any)

  1. Open https://jsfiddle.net/31dh68nv/
  2. Open console.
  3. Select and copy widget.
  4. Paste into widget's caption.

Expected result

There is no error in the console.

Actual result

There is error thrown:

(index):54 Uncaught TypeError: Cannot read property 'editables' of undefined
    at ckeditor.js:1116
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.htmlParser.element.forEach (ckeditor.js:284)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.htmlParser.element.forEach (ckeditor.js:284)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.htmlParser.element.forEach (ckeditor.js:284)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.htmlParser.element.forEach (ckeditor.js:284)
    at a.<anonymous> (ckeditor.js:1115)
    at a.c (ckeditor.js:10)
    at a.<anonymous> (ckeditor.js:11)
    at a.window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.CKEDITOR.editor.fire (ckeditor.js:13)
    at CKEDITOR.htmlDataProcessor.toDataFormat (ckeditor.js:305)

Other details

  • Installed CKEditor plugins: widget

Error is thrown only if getData is called from inside selectionChange callback. It does not throw in paste or afterPaste events. The order of events is:

  1. paste
  2. selectionChange (may be multiple)
  3. afterPaste

selectionChange in such scenario is fired in a weird moment, when pasted widget is already inside widget's content, but it's not upcasted yet.

Spinoff #1468.

@Comandeer Comandeer added type:bug A bug. status:confirmed An issue confirmed by the development team. plugin:widget The plugin which probably causes the issue. labels Jan 17, 2018
@Comandeer Comandeer self-assigned this Jan 17, 2018
@f1ames
Copy link
Contributor

f1ames commented Jan 17, 2018

Related to #1462.

@mlewand mlewand added the target:major Any docs related issue that should be merged into a major branch. label Jan 17, 2018
@mlewand mlewand added this to the Backlog milestone Aug 24, 2018
@lslowikowska lslowikowska added the support An issue reported by a commercially licensed client. label Aug 24, 2018
@lslowikowska lslowikowska added support:2 An issue reported by a commercially licensed client. and removed support An issue reported by a commercially licensed client. labels Dec 21, 2018
@uladzimir-miadzinski
Copy link

when will the fix?

@f1ames f1ames modified the milestones: Backlog, 4.12.0 Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin:widget The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. support:2 An issue reported by a commercially licensed client. target:major Any docs related issue that should be merged into a major branch. type:bug A bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants