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 inserting a link with the same href just after the link #8210

Closed
jerini opened this issue Oct 5, 2020 · 1 comment Β· Fixed by #8486
Closed

Editor crashes after inserting a link with the same href just after the link #8210

jerini opened this issue Oct 5, 2020 · 1 comment Β· Fixed by #8486
Assignees
Labels
squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@jerini
Copy link

jerini commented Oct 5, 2020

πŸ“ Provide detailed reproduction steps (if any)

1.Add link with example link
2. Add second link after it in the same line with same url

βœ”οΈ Expected result

Shuld add second link with same link url

❌ Actual result

error in the console "Uncaught CKEditorError: model-position-after-root" and can't add no more links

πŸ“ƒ Other details

@jerini jerini added the type:bug This issue reports a buggy (incorrect) behavior. label Oct 5, 2020
@Mgsy
Copy link
Member

Mgsy commented Oct 5, 2020

Hi, thanks for the report. I can reproduce it and it seems that this is a really old issue (reproducible even on version 17). The key here is to insert a new link with the same href just after the link.

  1. Open https://ckeditor.com/docs/ckeditor5/latest/features/link.html.
  2. Put the caret in the editable.
  3. Press Ctrl/Cmd + K, type something.
  4. Press Enter.
  5. Repeat steps 3 and 4.

The editor crashes:

snippet.js:4 Uncaught CKEditorError: model-position-after-root Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-model-position-after-root
 {"root":{"attributes":{"linkHref":"test"},"data":"test"}}
    at Function._createAfter (https://ckeditor.com/docs/ckeditor5/latest/snippets/features/build-link-source/snippet.js:4:15025)
    at cn.createPositionAfter (https://ckeditor.com/docs/ckeditor5/latest/snippets/features/build-link-source/snippet.js:4:430352)
    at Oe.createPositionAfter (https://ckeditor.com/docs/ckeditor5/latest/snippets/features/build-link-source/snippet.js:4:393357)
    at Object.callback (https://ckeditor.com/docs/ckeditor5/latest/snippets/features/build-link-source/snippet.js:4:297584)
    at cn._runPendingChanges (https://ckeditor.com/docs/ckeditor5/latest/snippets/features/build-link-source/snippet.js:4:430940)
    at cn.change (https://ckeditor.com/docs/ckeditor5/latest/snippets/features/build-link-source/snippet.js:4:427766)
    at p.execute (https://ckeditor.com/docs/ckeditor5/latest/snippets/features/build-link-source/snippet.js:4:297100)
    at p.<anonymous> (https://ckeditor.com/docs/ckeditor5/latest/snippets/features/build-link-source/snippet.js:4:33953)
    at p.fire (https://ckeditor.com/docs/ckeditor5/latest/snippets/features/build-link-source/snippet.js:4:25493)
    at p.<computed> [as execute] (https://ckeditor.com/docs/ckeditor5/latest/snippets/features/build-link-source/snippet.js:4:34004)

@Mgsy Mgsy added the squad:core Issue to be handled by the Core team. label Oct 5, 2020
@Mgsy Mgsy changed the title Link error Editor crashes after inserting link with the same href just after the link Oct 5, 2020
@Mgsy Mgsy changed the title Editor crashes after inserting link with the same href just after the link Editor crashes after inserting a link with the same href just after the link Oct 5, 2020
@Reinmar Reinmar added this to the nice-to-have milestone Oct 7, 2020
@niegowski niegowski modified the milestones: nice-to-have, iteration 38 Nov 19, 2020
@niegowski niegowski self-assigned this Nov 19, 2020
jodator added a commit that referenced this issue Nov 24, 2020
Fix (link): Editor should not crash after inserting a link after another link with the same URL. Closes #8210.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
squad:core Issue to be handled by the Core team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants