Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
17.10.14, 18.8.0
-
None
-
Unknown
-
Description
These macros show or use something that a parameter names: a page, a source, an extension point or a parameter of the wiki macro. When that target does not exist, or is of the wrong kind, they render nothing with no message, or give an error whose cause is wrong, so the user cannot tell what to fix.
The macros to change, with the file where most of the fix is done:
- include and display: AbstractIncludeMacro.java, which both extend.
- context: ContextMacro.java.
- uiextensions: UIExtensionsMacro.java.
- wikimacroparameter: WikiMacroParameterMacro.java.
The main problems:
- include and display: type="SPACE" renders nothing, type="ATTACHMENT" gives a recursion error, a wrong cause, and reference="" gives "Found recursive display of document" instead of saying that the page is missing.
- context: the document is a plain string that is never checked, so a page that does not exist is accepted silently, and source="nocolon" renders the text itself.
- uiextensions: an unknown extension point renders nothing. The macro cannot tell it from a point with no extension, but the editor could say that no extension uses it, since the identifiers are case sensitive and easy to mistype.
- wikimacroparameter: a name that matches no parameter of the wiki macro renders an empty placeholder, in view mode and in the editor, while the macro knows the parameters of the wiki macro it is used in.
The fix is to check the target before using it and, when it is missing or of the wrong kind, to fail with an error that names the parameter and the target. For include, a page that does not exist yet stays a valid use, so the message is only needed in the editor.
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.
KOs covered
| Macro | Criterion | Problem |
|---|---|---|
| include | E2 errors | type="SPACE" renders nothing, type="ATTACHMENT" gives "Found recursive inclusion of document", a wrong cause, and a page that does not exist renders nothing, a valid use that the editor could point out. Partly covered, see below. |
| display | E2 errors | type="SPACE" renders nothing, type="ATTACHMENT" gives "Infinite document inclusion detected.", a wrong cause, and reference="" gives "Found recursive display of document [...]" instead of saying that the page is missing. Partly covered, see below. |
| context | E2 errors | A document that does not exist, or a malformed one, is accepted silently, since the document is a plain string that is never checked, and source="nocolon" renders the text itself, with no message. Partly covered, see below. |
| uiextensions | E2 errors | {{uiextensions extensionPoint="org.xwiki.nosuch.Point"/}}, an empty point, a wrong case or a value with a space all render nothing, with no way to find a typo. Partly covered, see below. |
| wikimacroparameter | E2 errors | A name that matches no parameter of the wiki macro, like {{wikimacroparameter name="nope"/}}, renders an empty placeholder with no message, and a content typed in the dialog is accepted and ignored. Partly covered, see below. |
Impact found on macro fluidity
These 5 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.
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
-