Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
18.7.0-rc-1
-
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
- Create a subwiki and make BlockNote the WYSIWYG editor.
- Attach an image to a page of the subwiki and wait for it to be indexed.
- Edit a page of the subwiki with BlockNote and type /image, then select "Image".
- 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
- relates to
-
XWIKI-24241 The image quick action should provide image suggestions and allow browsing existing images
-
- Closed
-
-
XWIKI-24269 Improvements for the link insertion dialog
-
- Closed
-