This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-ba2f330d-c9f0-440a-b9d4-324e1ab254e9 XWIKI-25580 Open

Report the invalid values of the documents, documentTree and tree macros instead of an empty result

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-15be5ff8-0dee-4a40-b66c-72104284019d Charpentier Lucas created this issue on 23/Oct/26 17:13
 
Summary: Report the invalid values of the documents, documentTree and tree macros instead of an empty result
Issue Type: cid:jira-generated-image-avatar-ba2f330d-c9f0-440a-b9d4-324e1ab254e9 Improvement
Affects Versions: 17.10.14, 18.8.0
Assignee: Unassigned
Components: Index, Tree
Created: 23/Oct/26 17:13
Priority: cid:jira-generated-image-static-major-274102bb-ed96-4ca8-968c-ef2551c2f4e8 Major
Reporter: Charpentier Lucas
Description:

The page list and tree macros accept any value for their columns, filters, roots and modes. An unknown value gives an empty table, "(No entries)", "No pages found" or the default tree, with no message, so the user cannot tell an invalid value from a part of the wiki with no pages.

The macros to change, with the file where most of the fix is done:

The main problems:

  • documents: an unknown column, like doc.noSuch, or columns="title,author" gives an empty table; an unknown filter is ignored; a space or parent that does not exist shows "(No entries)".
  • documentTree: an unknown hierarchyMode or sortDocumentsBy renders the default tree, and a root that does not exist renders "No pages found".
  • tree: a reference to a page that does not exist renders nothing, and a content that is not a bulleted list, like a paragraph, a table or a numbered list, renders nothing in view mode while the editor shows it.

The fix is to check these values in each wiki macro and to show an error naming the parameter when one is unknown, or missing for a page, so that an empty result only means that there are no pages.

Depends on

  • XCOMMONS-3847, which refuses the boolean and number values that do not convert.
  • XRENDERING-823, which makes the error of an invalid parameter name the parameter and the expected value.
  • XWIKI-25197, which lets a wiki macro parameter declare a range or a format, checked when the macro runs.

KOs covered

Macro Criterion Problem
documents E2 errors columns="doc.noSuch" and columns="title,author" show an empty table, filters="noSuch=abc" is ignored, and a space or parent that does not exist shows "(No entries)", all with no message. Partly covered, see below.
documentTree E2 errors hierarchyMode="abc" and sortDocumentsBy="title:sideways" render the default tree, and root="abc" renders "No pages found", with no message about the root. Partly covered, see below.
tree E2 errors A reference to a page that does not exist renders nothing, and a content that is not a bulleted list renders nothing in view mode, with no message. Partly covered, see below.

Impact found on macro fluidity

These 3 KOs come from the WYSIWYG usability audit of the macros, under the criterion E2 errors of its usability criteria, which asks that an invalid parameter value produces a message that says what is wrong and how to fix it, not a stack trace. The page of each macro, linked in the table, has the full notes and the steps to reproduce.

Each of these KOs is only partly covered here, for the problems specific to the macro. The same KOs also report invalid values that the macro system handles for every macro: XCOMMONS-3847 refuses the booleans and numbers that do not convert, and XRENDERING-823 makes the error name the parameter and the expected value. The number and format constraints, like limit and expandToLevel, are covered by XWIKI-25197.