This issue has been created
There are 2 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-198a8021-5029-4464-826f-a030247dab25 XWIKI-22415 Open

JS errors that prevent adding comments or annotations when realtime editing is activated from Administration

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-d3a9879f-4df5-4576-b816-b0a1cdf2836d Ilie Andriuta created this issue on 12/Aug/24 14:49
 
Summary: JS errors that prevent adding comments when realtime editing is activated from Administration
Issue Type: cid:jira-generated-image-avatar-198a8021-5029-4464-826f-a030247dab25 Bug
Affects Versions: 15.10.11, 16.4.1, 16.6.0
Assignee: Unassigned
Attachments: CKEditor_errors_comment_not_added_16_4_1.png, CKEditor_errors_comment_not_added_16_6_0.png, localhost-1723465931941_channels.log, localhost-1723466111758_getClientRect.log, localhost-1723466707144_getSelection.log
Components: Realtime
Created: 12/Aug/24 14:49
Environment: Windows 11 Pro, Chrome 127, using a local instance of XWiki 16.6.0 on PostgreSQL 16, Tomcat 9.0.91
Priority: cid:jira-generated-image-static-major-13f21ea1-5947-4ffa-b589-3faea97c2e3d Major
Reporter: Ilie Andriuta
Description:

Steps to reproduce

  1. Login as Admin and enable Realtime editing from Administration
  2. Go to a page
  3. Click "Comment" button
  4. Observe the JS console logs
  5. Add a comment
  6. Add a second comment
  7. Observe the JS console logs

Expected results

Not errors are displayed. The comments are added without any issues.

Actual results

On Step 4, after clicking the "Comment" button, a JS error is displayed;

wysiwygEditor.js:65  Uncaught TypeError: Cannot read properties of undefined (reading 'channels')
    at new z (wysiwygEditor.js:65:39)
    at plugin.js:315:30
    at Object.execCb (require.min.js?r=1:5:16727)
    at e.check (require.min.js?r=1:5:10499)
    at e.<anonymous> (require.min.js?r=1:5:12915)
    at require.min.js?r=1:5:1542
    at require.min.js?r=1:5:13376
    at each (require.min.js?r=1:5:1020)
    at e.emit (require.min.js?r=1:5:13344)
    at e.check (require.min.js?r=1:5:11058)

Then, after adding a comment, the following one is not added. A red error box is displayed on the browser below footer each time the "Add comment" button is clicked:

The content cannot be saved because of a CKEditor internal error. You should try to copy your important changes and reload the editor.

And some errors displayed in JS console:

ckeditor.js:458  Uncaught TypeError: Cannot read properties of undefined (reading 'getSelection')
    at CKEDITOR.dom.selection.getNative (ckeditor.js:458:125)
    at new CKEDITOR.dom.selection (ckeditor.js:456:179)
    at CKEDITOR.editor.getSelection (ckeditor.js:453:347)
    at e.<anonymous> (plugin.js:270:28)
    at e.l (ckeditor.js:10:246)
    at e.<anonymous> (ckeditor.js:12:91)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.CKEDITOR.editor.fire (ckeditor.js:13:285)
    at e.getData (ckeditor.js:275:166)
    at e.k (ckeditor.js:1312:64)
    at e.l (ckeditor.js:10:246)
ckeditor.js:701  Uncaught TypeError: Cannot read properties of null (reading 'getClientRect')
    at k._layout (ckeditor.js:701:45)
    at k.add (ckeditor.js:697:363)
    at e.show (ckeditor.js:692:184)
    at e.showNotification (ckeditor.js:691:420)
    at Object.updateContent (plugin.js:133:16)
    at Object.<anonymous> (plugin.js:116:75)
    at Array.forEach (<anonymous>)
    at Object.updateFormFields (plugin.js:115:20)
    at Object.<anonymous> (plugin.js:60:19)
    at HTMLDocument.dispatch (jquery.min.js?r=1:2:40035)
ckeditor.js:701  Uncaught TypeError: Cannot read properties of null (reading 'getClientRect')
    at k._layout (ckeditor.js:701:45)
    at e._output (ckeditor.js:30:77)
    at e._call (ckeditor.js:50:419)
    at f (ckeditor.js:20:287)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.dom.window.input (ckeditor.js:20:447)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.dom.window.l (ckeditor.js:10:246)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.dom.window.fire (ckeditor.js:12:91)
    at ckeditor.js:65:66

As the full stacktraces could not be copied directly from JS console, please find attached the saved logs for each error.

The issue reproduces also on XWiki 15.10.11, 16.4.1 and 16.5.0.

 
 

2 updates

 
cid:jira-generated-image-avatar-d3a9879f-4df5-4576-b816-b0a1cdf2836d Changes by Ilie Andriuta on 12/Aug/24 14:56
 
Summary: JS errors that prevent adding comments or annotations when realtime editing is activated from Administration
Description: *Steps to reproduce*
# Login as Admin and enable Realtime editing from Administration
# Go to a page
# Click "Comment" button
# Observe the JS console logs
# Add a comment
# Add a second comment
# Observe the JS console logs

*Expected results*

Not errors are displayed. The comments are added without any issues.

*Actual results*

On Step 4, after clicking the "Comment" button, a JS error is displayed;
{code:java}
wysiwygEditor.js:65  Uncaught TypeError: Cannot read properties of undefined (reading 'channels')
    at new z (wysiwygEditor.js:65:39)
    at plugin.js:315:30
    at Object.execCb (require.min.js?r=1:5:16727)
    at e.check (require.min.js?r=1:5:10499)
    at e.<anonymous> (require.min.js?r=1:5:12915)
    at require.min.js?r=1:5:1542
    at require.min.js?r=1:5:13376
    at each (require.min.js?r=1:5:1020)
    at e.emit (require.min.js?r=1:5:13344)
    at e.check (require.min.js?r=1:5:11058){code}
Then, after adding a comment, the following one is not added. A red error box is displayed on the browser below footer each time the "Add comment" button is clicked:
{code:java}
The content cannot be saved because of a CKEditor internal error. You should try to copy your important changes and reload the editor.{code}
And some errors displayed in JS console:
{code:java}
ckeditor.js:458  Uncaught TypeError: Cannot read properties of undefined (reading 'getSelection')
    at CKEDITOR.dom.selection.getNative (ckeditor.js:458:125)
    at new CKEDITOR.dom.selection (ckeditor.js:456:179)
    at CKEDITOR.editor.getSelection (ckeditor.js:453:347)
    at e.<anonymous> (plugin.js:270:28)
    at e.l (ckeditor.js:10:246)
    at e.<anonymous> (ckeditor.js:12:91)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.CKEDITOR.editor.fire (ckeditor.js:13:285)
    at e.getData (ckeditor.js:275:166)
    at e.k (ckeditor.js:1312:64)
    at e.l (ckeditor.js:10:246){code}
{code:java}
ckeditor.js:701  Uncaught TypeError: Cannot read properties of null (reading 'getClientRect')
    at k._layout (ckeditor.js:701:45)
    at k.add (ckeditor.js:697:363)
    at e.show (ckeditor.js:692:184)
    at e.showNotification (ckeditor.js:691:420)
    at Object.updateContent (plugin.js:133:16)
    at Object.<anonymous> (plugin.js:116:75)
    at Array.forEach (<anonymous>)
    at Object.updateFormFields (plugin.js:115:20)
    at Object.<anonymous> (plugin.js:60:19)
    at HTMLDocument.dispatch (jquery.min.js?r=1:2:40035){code}
{code:java}
ckeditor.js:701  Uncaught TypeError: Cannot read properties of null (reading 'getClientRect')
    at k._layout (ckeditor.js:701:45)
    at e._output (ckeditor.js:30:77)
    at e._call (ckeditor.js:50:419)
    at f (ckeditor.js:20:287)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.dom.window.input (ckeditor.js:20:447)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.dom.window.l (ckeditor.js:10:246)
    at window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.dom.window.fire (ckeditor.js:12:91)
    at ckeditor.js:65:66{code}
The same issue reproduces when adding annotations.

As the full stacktraces could not be copied directly from JS console, please find attached the saved logs for each error.

The issue reproduces also on XWiki 15.10.11, 16.4.1 and 16.5.0.