Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
17.10.14, 18.8.0
-
None
-
Unknown
-
Description
When a macro parameter is invalid, the macro is replaced by "Invalid macro parameters used for the [macro] macro." followed by the message of the root cause of the exception. That message is written for developers. It does not say which parameter is wrong or what value is expected, so on a macro with several parameters the user has to guess which one to fix.
Steps to reproduce
- Edit a page with the wiki editor.
- Add {{toc depth="0"/}}, {{toc scope="abc"/}} and {{translation key="core.menu.create" locale="xx_bogus"/}}.
- Save and view the page.
Expected
Each error names the parameter, the value given and what is accepted, for example "The value [0] of the [depth] parameter must be greater than or equal to 1."
Actual
- depth="0": "Cause: [Failed to validate bean: [must be greater than or equal to 1]]"
- scope="abc": "Cause: [Unable to convert value [abc]. Allowed values are (case insensitive) "LOCAL" or "PAGE".]"
- locale="xx_bogus": "Cause: [Invalid locale format: xx_bogus]"
The parameter name is known when the error happens: DefaultBeanManager wraps a conversion failure in "Failed to populate property [name]", but the error box only shows the root cause, so that part is lost. A failed @Min or @Pattern constraint only keeps the message of the first violation, without its property path.
The WYSIWYG usability audit of the macros found this on most of the 58 macros failing its error criterion.
Attachments
Issue Links
- blocks
-
XWIKI-25578 Report a missing or unknown target in the errors of the include, display, context, uiextensions and wikimacroparameter macros
-
- Open
-
-
XWIKI-25579 Report a missing or invalid jar in the errors of the script macros
-
- Open
-
-
XWIKI-25580 Report the invalid values of the documents, documentTree and tree macros instead of an empty result
-
- Open
-
-
XWIKI-25581 Report the invalid values of the attachmentGalleryPicker and attachmentSelector macros instead of showing nothing
-
- Open
-
-
XWIKI-25582 Refuse the invalid values of the cache, code, container, gallery and menu macros instead of ignoring them
-
- Open
-
-
XWIKI-25583 Report a missing user or icon in the displayIcon, mention and useravatar macros instead of falling back silently
-
- Open
-
- is related to
-
XCOMMONS-3847 Invalid boolean and number values of a bean property are silently converted instead of failing
-
- Open
-
-
XRENDERING-828 Provide an image picker for the image parameter of the box and message macros
-
- Open
-
- relates to
-
XRENDERING-720 Make macro execution exceptions translatable
-
- Open
-
-
XWIKI-24418 Properly report incorrect macros invocation
-
- Open
-
-
XWIKI-25287 The Edit Macro dialog doesn't enforce the constraints declared on the parameters of Java macros
-
- Open
-