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

BlockNote link and image suggestions are taken from the main wiki when editing a page of a subwiki

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 18.7.0-rc-1
    • BlockNote
    • None
    • Unknown

    Description

      When editing a page of a subwiki with the BlockNote editor, the page, attachment and image suggestions come from the main wiki instead of the edited wiki. This affects:

      • the image quick action (/image, or image: followed by a file name), whose suggestions are the images attached in the main wiki
      • the link modal and the link quick action, whose Page and Attachment suggestions are main wiki entities

      So a user editing in a subwiki cannot pick an image or a page of their own wiki from the suggestions, and picking a suggestion inserts a reference to an entity of the main wiki.

      Cause

      The XWiki link suggest service of @xwiki/platform-link-suggest-xwiki always adds a wiki:xwiki filter query to the Solr query it sends to XWiki/SuggestSolrService (see initializeSolrQueryParameters in core/link-suggest/link-suggest-xwiki/src/components/componentsInit.ts), so only the entities of the main wiki (xwiki) can match, whatever the edited wiki.

      The filter dates from the Cristal implementation of internal link autocompletion (CRISTAL-177). XWiki uses this service in BlockNote since 18.7.0RC1 (XWIKI-24269); before that, BlockNote had no link suggestions.

      Expected

      The suggestions should come from the wiki of the edited page (the current wiki).

      Steps to reproduce

      1. Create a subwiki and make BlockNote the WYSIWYG editor.
      2. Attach an image to a page of the subwiki and wait for it to be indexed.
      3. Edit a page of the subwiki with BlockNote and type /image, then select "Image".
      4. The suggested images are the most recent images of the main wiki; typing the name of the subwiki image doesn't find it.

      Found while documenting XWIKI-24241, by reading the code; not reproduced on a running subwiki yet.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mflorea Marius Dumitru Florea
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: