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:
- documents: defined in its wiki macro, DocumentsMacro.xml.
- documentTree: defined in its wiki macro, DocumentTree.xml.
- tree: defined in its wiki macro, Tree.xml.
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.
Attachments
Issue Links
- depends on
-
XCOMMONS-3847 Invalid boolean and number values of a bean property are silently converted instead of failing
-
- Open
-
-
XRENDERING-823 The error shown for an invalid macro parameter doesn't name the parameter or the expected value
-
- Open
-
-
XWIKI-25197 Allow wiki macro parameters to declare a range or a format for their value
-
- Open
-