Closed scottfr closed 3 years ago
I can reproduce the issue. It seems to be connected with editor.inserHtml
function.
The whole error stack:
Uncaught TypeError: Cannot read property 'getParents' of null
at d (ckeditor.js:149)
at CKEDITOR.dom.range.extractContents (ckeditor.js:154)
at CKEDITOR.dom.range.splitElement (ckeditor.js:180)
at ckeditor.js:410
at $.insertHtml (ckeditor.js:374)
at $.<anonymous> (ckeditor.js:384)
at a.n (ckeditor.js:10)
at a.<anonymous> (ckeditor.js:12)
at a.CKEDITOR.editor.CKEDITOR.editor.fire (ckeditor.js:13)
at a.insertHtml (ckeditor.js:286)
I've seen a lot of TypeError: Cannot read property 'getParents' of null
in our Sentry logs recently as well. It does not appear to be triggered in the same manner as here though, but I would not be surprised if it is related to the "paste from Word" functionality or the like, which probably uses insertHtml
?
We have another user who is affected by this bug. It would be great if it could be looked into.
Have there been any updates to this issue? I'm seeing a lot of these errors in our Sentry logs but I've only managed to reproduce this issue following steps posted here. I can't seem to reproduce the issue on an older CKEditor 4 version, such as 4.2. The one we're currently using is on 4.16.
Type of report
Bug
Provide detailed reproduction steps (if any)
{ enterMode: CKEDITOR.ENTER_BR, shiftEnterMode: CKEDITOR.ENTER_BR }
(standard p mode does not have this issue)<p>a</p><p>b</p>
(if you copy this from an editor, make sure you copy it with p-tags and not a br as the br will work fine)a
(or any other letter), then a backspace to delete the letter you just typed (this is important to do otherwise the issue does not manifest itself)So again: paste, enter twice, any letter, delete letter, paste again.
Here's a code pen with CKEditor 4 and text ready to copy:
https://codepen.io/scottfr/pen/WNvQgwp
Expected result
The editor's content is:
Actual result
The editor's content is:
The javascript console has the error:
ckeditor.js:155 Uncaught TypeError: Cannot read property 'getParents' of null at d (ckeditor.js:155)
Other details