Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-21855

Error in JS console when adding an annotation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 15.10.6, 16.1.0-rc-1
    • 15.6-rc-1
    • Annotations
    • Windows 11 Pro, Edge 121, Firefox 122, using a local instance of XWiki 15.10.5 on MariaDB 11.2, Tomcat 9.0.85, reproducible also on Jetty/MySQL
    • Unknown
    • N/A
    • N/A

    Description

      Steps to reproduce

      1. Login as Admin/ user
      2. Go to a page with some text
      3. Select a word and press CTRL + M to add an annotation
      4. Insert something in Annotation box
      5. Click 'Add Annotation'
      6. Observe the browser's JS console

      Expected results

      No errors are displayed.

      Actual results

      There is an error displayed:

      • On Edge 121 and Chrome 121:
      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:152:34)
          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 CKEDITOR.focusManager.k (ckeditor.js:244:78)
          at CKEDITOR.focusManager.<anonymous> (ckeditor.js:244:283)
          at ckeditor.js:28:254
      getNative @ ckeditor.js:458
      CKEDITOR.dom.selection @ ckeditor.js:456
      CKEDITOR.editor.getSelection @ ckeditor.js:453
      (anonymous) @ plugin.js:152
      l @ ckeditor.js:10
      (anonymous) @ ckeditor.js:12
      window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.CKEDITOR.editor.fire @ ckeditor.js:13
      k @ ckeditor.js:244
      (anonymous) @ ckeditor.js:244
      (anonymous) @ ckeditor.js:28
      setTimeout (async)
      setTimeout @ ckeditor.js:28
      blur @ ckeditor.js:244
      blur @ ckeditor.js:245
      l @ ckeditor.js:10
      (anonymous) @ ckeditor.js:12
      (anonymous) @ ckeditor.js:65
      • On Firefox 122:
      Uncaught TypeError: this.document.getWindow().$ is undefined
          getNative ckeditor.js:458
          selection ckeditor.js:456
          getSelection ckeditor.js:453
          init plugin.js:152
          l ckeditor.js:10
          fire ckeditor.js:12
          fire ckeditor.js:13
          k ckeditor.js:244
          timer ckeditor.js:244
          setTimeout ckeditor.js:28
          setTimeout handler*setTimeout ckeditor.js:28
          blur ckeditor.js:244
          blur ckeditor.js:245
          l ckeditor.js:10
          fire ckeditor.js:12
          prototype ckeditor.js:65
          on ckeditor.js:65
          on ckeditor.js:368
          setup ckeditor.js:382
          e ckeditor.js:1451
          setTimeout ckeditor.js:28
          setTimeout handler*setTimeout ckeditor.js:28
          frameLoadedHandler ckeditor.js:1460
          addFunction ckeditor.js:31
          callFunction ckeditor.js:31
          onload line 87 > injectedScript:5
          EventListener.handleEvent* line 87 > injectedScript:5
          write ckeditor.js:87
          setData ckeditor.js:1466
          setup ckeditor.js:380
          l ckeditor.js:10
          fire ckeditor.js:12
          fire ckeditor.js:13
          setData ckeditor.js:276
          e ckeditor.js:1456
          l ckeditor.js:10
          fire ckeditor.js:12
          prototype ckeditor.js:65
          on ckeditor.js:65
          init ckeditor.js:1458
          setMode ckeditor.js:358
          e ckeditor.js:352
          l ckeditor.js:10
          fire ckeditor.js:12
          fire ckeditor.js:13
          fireOnce ckeditor.js:12
          fireOnce ckeditor.js:13
          n ckeditor.js:269
          n ckeditor.js:249
          load ckeditor.js:249
          n ckeditor.js:268
          g ckeditor.js:255
          load ckeditor.js:254
          n ckeditor.js:249
          load ckeditor.js:249
          load ckeditor.js:253
          g ckeditor.js:254
          g ckeditor.js:255
          load ckeditor.js:254
          n ckeditor.js:249
          load ckeditor.js:249
          load ckeditor.js:253
          g ckeditor.js:254
          load ckeditor.js:255
          n ckeditor.js:267
          f ckeditor.js:266
          getStylesSet ckeditor.js:511
          load ckeditor.js:254
      ckeditor.js:458:112
          getNative ckeditor.js:458
          selection ckeditor.js:456
          getSelection ckeditor.js:453
          init plugin.js:152
          l ckeditor.js:10
          fire ckeditor.js:12
          fire ckeditor.js:13
          k ckeditor.js:244
          timer ckeditor.js:244
          setTimeout ckeditor.js:28
          (Async: setTimeout handler)
          setTimeout ckeditor.js:28
          blur ckeditor.js:244
          blur ckeditor.js:245
          l ckeditor.js:10
          fire ckeditor.js:12
          prototype ckeditor.js:65
          (Async: EventListener.handleEvent)
          on ckeditor.js:65
          on ckeditor.js:368
          setup ckeditor.js:382
          e ckeditor.js:1451
          setTimeout ckeditor.js:28
          (Async: setTimeout handler)
          setTimeout ckeditor.js:28
          frameLoadedHandler ckeditor.js:1460
          addFunction ckeditor.js:31
          callFunction ckeditor.js:31
          onload line 87 > injectedScript:5
          (Async: EventListener.handleEvent)
          <anonymous> line 87 > injectedScript:5
          write ckeditor.js:87
          setData ckeditor.js:1466
          setup ckeditor.js:380
          l ckeditor.js:10
          fire ckeditor.js:12
          fire ckeditor.js:13
          setData ckeditor.js:276
          e ckeditor.js:1456
          l ckeditor.js:10
          fire ckeditor.js:12
          prototype ckeditor.js:65
          (Async: EventListener.handleEvent)
          on ckeditor.js:65
          init ckeditor.js:1458
          setMode ckeditor.js:358
          e ckeditor.js:352
          l ckeditor.js:10
          fire ckeditor.js:12
          fire ckeditor.js:13
          fireOnce ckeditor.js:12
          fireOnce ckeditor.js:13
          n ckeditor.js:269
          n ckeditor.js:249
          load ckeditor.js:249
          n ckeditor.js:268
          g ckeditor.js:255
          load ckeditor.js:254
          n ckeditor.js:249
          load ckeditor.js:249
          load ckeditor.js:253
          g ckeditor.js:254
          g ckeditor.js:255
          load ckeditor.js:254
          n ckeditor.js:249
          load ckeditor.js:249
          load ckeditor.js:253
          g ckeditor.js:254
          load ckeditor.js:255
          n ckeditor.js:267
          f ckeditor.js:266
          getStylesSet ckeditor.js:511
          load ckeditor.js:254

       
      Nevertheless, the annotations are added.

      The error could not be reproduced on XWiki 14.10.20.

      Attachments

        Issue Links

          Activity

            People

              mflorea Marius Dumitru Florea
              iandriuta Ilie Andriuta
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: