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

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

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • None
    • None
    • Unknown

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Lucas C Charpentier Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: