This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-31bbb672-80b1-4541-8691-40d2af16fdb1 XWIKI-25062 Open

Log a warning when the search scope of a suggest picker cannot be resolved

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-d63477eb-1fe4-46fb-8ea5-4adb33e2dbf3 Charpentier Lucas created this issue on 30/Sep/26 15:57
 
Summary: Log a warning when the search scope of a suggest picker cannot be resolved
Issue Type: cid:jira-generated-image-avatar-31bbb672-80b1-4541-8691-40d2af16fdb1 Improvement
Assignee: Unassigned
Components: Web - Templates & Resources
Created: 30/Sep/26 15:57
Priority: cid:jira-generated-image-static-major-792f8bd6-0e7a-474d-80a5-919f106d7879 Major
Reporter: Charpentier Lucas
Description:

The page, attachment and space pickers accept a search scope, passed through the data-search-scope attribute of the picker input, of the form entityType:entityReference (e.g. wiki:xwiki or space:Sandbox). When this value cannot be resolved, the pickers silently fall back to searching the current wiki.

This fallback is fine, but because the error is swallowed without any trace, a developer who configures a wrong search scope only notices that the suggestions come from the wrong place, with nothing in the browser console to explain why.

The resolveEntityReference function of the following scripts should log a warning, naming the search scope that could not be resolved, before falling back:

  • uicomponents/suggest/suggestPages.js
  • uicomponents/suggest/suggestAttachments.js
  • uicomponents/suggest/suggestSpaces.js, introduced by XWIKI-24636

The three scripts share the same code, so they should be changed together to stay consistent.