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

Editor crashes after undoing styles on a table #6265

Closed
Mgsy opened this issue Feb 14, 2020 · 1 comment · Fixed by ckeditor/ckeditor5-engine#1832
Closed

Editor crashes after undoing styles on a table #6265

Mgsy opened this issue Feb 14, 2020 · 1 comment · Fixed by ckeditor/ckeditor5-engine#1832
Assignees
Labels
package:engine package:table package:undo type:bug This issue reports a buggy (incorrect) behavior. type:regression This issue reports a bug that was not present in the previous releases.

Comments

@Mgsy
Copy link
Member

Mgsy commented Feb 14, 2020

📝 Provide detailed reproduction steps (if any)

  1. Add a table.
  2. Open the table properties balloon.
  3. Add a background color.
  4. Put the caret in a cell.
  5. Open the cell properties balloon.
  6. Add a background color.
  7. Undo twice.

✔️ Expected result

Styles are removed.

❌ Actual result

The editor crashes.

📃 Other details

Error

ckeditorerror.js:66 Uncaught CKEditorError: attribute-operation-range-not-flat: The range to change is not flat. Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-attribute-operation-range-not-flat

    at l._validate (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:54557)
    at kn.on.priority (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:380379)
    at kn.fire (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:22217)
    at kn.<computed> [as applyOperation] (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:29799)
    at E._undo (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:428562)
    at Object.callback (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:429060)
    at kn._runPendingChanges (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:384143)
    at kn.enqueueChange (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:381201)
    at E.execute (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:429034)
    at E.<anonymous> (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:29748)

GIF
bug_cke5


If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@Mgsy Mgsy added type:bug This issue reports a buggy (incorrect) behavior. status:confirmed package:table labels Feb 14, 2020
@Mgsy
Copy link
Member Author

Mgsy commented Feb 14, 2020

If we'll add styling in a different order (starting from a table cell) there will be a different error:

ckeditorerror.js:66 Uncaught CKEditorError: attribute-operation-attribute-exists: The attribute with given key already exists. Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-attribute-operation-attribute-exists
 {"node":{"attributes":{"borderStyle":"solid","borderWidth":"12px"},"name":"tableCell","children":[{"name":"paragraph","children":[{"data":"yes"}]}]},"key":"borderWidth"}
    at l._validate (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:55020)
    at kn.on.priority (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:380379)
    at kn.fire (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:22217)
    at kn.<computed> [as applyOperation] (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:29799)
    at E._undo (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:428562)
    at Object.callback (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:429060)
    at kn._runPendingChanges (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:384143)
    at kn.enqueueChange (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:381201)
    at E.execute (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:429034)
    at E.<anonymous> (http://192.168.1.81:8080/build/docs/ckeditor5/latest/snippets/features/build-table-source/snippet.js:4:29748)

@Reinmar Reinmar added this to the next milestone Feb 14, 2020
@Reinmar Reinmar added the type:regression This issue reports a bug that was not present in the previous releases. label Feb 14, 2020
@Reinmar Reinmar modified the milestones: next, iteration 30 Feb 21, 2020
@mlewand mlewand modified the milestones: iteration 30, iteration 31 Mar 11, 2020
Reinmar added a commit to ckeditor/ckeditor5-engine that referenced this issue Mar 27, 2020
Fix: Fixed a crash that was happening in some scenarios when undoing table background change. Closes ckeditor/ckeditor5#6265.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine package:table package:undo type:bug This issue reports a buggy (incorrect) behavior. type:regression This issue reports a bug that was not present in the previous releases.
Projects
None yet
4 participants