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

When using the Mentions macro, new instances of CKEditor can fail to load after page initialization

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 13.4.4
    • Fix Version/s: 13.4.6, 13.10.2, 14.0-rc-1
    • Component/s: Mentions
    • Labels:
      None
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      The Mentions macro will wrap an existing CKEditor method : ckeditor.replace with another method : https://github.com/xwiki/xwiki-platform/blob/ac12f8e2f29d301d4dcd677381c24b864fa1544b/xwiki-platform-core/xwiki-platform-mentions/xwiki-platform-mentions-ui/src/main/resources/XWiki/Mentions/MentionsMacro.xml#L235

      However, in some cases, especially when loading a new instance of CKEditor after the page is loaded, ckeditor.replace can be called with an undefined configuration. In that case, the following line will fail, as newConf.mentions doesn't exist.

      https://github.com/xwiki/xwiki-platform/blob/ac12f8e2f29d301d4dcd677381c24b864fa1544b/xwiki-platform-core/xwiki-platform-mentions/xwiki-platform-mentions-ui/src/main/resources/XWiki/Mentions/MentionsMacro.xml#L229

      The use case for this issue is difficult to reproduce, however we found the issue as part of a project allowing to edit objects in a page using a technique similar to https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/Add%20Remove%20Objects%20Inline%20Tutorial . In that case, the addition of a first object containing a WYSIWYG editor would work well, but as soon as a second object gets added, the following stacktrace would be raised, and the CKEditor would not load properly anymore :

        Attachments

          Activity

            People

            Assignee:
            mleduc Manuel Leduc
            Reporter:
            caubin Clément Aubin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response: