There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-9613f8b8-a280-42c6-8b9a-ec7806a03dfb XWIKI-25500 Open

Offer the script languages and the Velocity filters as lists in the Edit Macro dialog

 
View issue   ยท   Add comment
 

1 update

 
cid:jira-generated-image-avatar-20e0c0cc-21b6-4969-b31f-fc6470359e1e Changes by Charpentier Lucas on 23/Oct/26 16:53
 
Description: The script and velocity macros take an identifier chosen among the components installed on the wiki in a free text field, so the user has to know it and a wrong one is accepted or refused with a technical message.

The macros to change, with the file where most of the fix is done:
* script: [DefaultScriptMacroParameters.java|https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-script/src/main/java/org/xwiki/rendering/macro/script/DefaultScriptMacroParameters.java].
* velocity: [VelocityMacroParameters.java|https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-velocity/src/main/java/org/xwiki/rendering/macro/velocity/VelocityMacroParameters.java].

The main problem:
* The values are components, script engines and Velocity filters, so the list has to be computed on the wiki rather than fixed in the macro.

A value outside these lists must also fail when the macro renders, with an error that names the parameter and lists the accepted values, instead of being ignored or giving a technical message.

h2. Depends on
Most of these fields cannot be offered before these generic changes, each giving the macro the means to declare the expected value:
* XWIKI-23045, which lets a parameter get its values from a provider, with or without custom values.

h2. KOs covered
||Macro||Criterion||Parameter||Problem||Depends on||
|[script|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/script/]|C4 input-assistance|{{language}}|A free text field for an identifier chosen among the script engines installed on the wiki; a wrong value is refused with a message about the engine.|XWIKI-23045|
|[velocity|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/velocity/]|C4 input-assistance|{{filter}}|A free text field for one of the filters none, indent and html; a wrong value is accepted silently.|XWIKI-23045|
|[script|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/script/]|E2 errors|{{language}}|A wrong language, like "nosuchlanguage" or "PYTHON", gives "Can't find script engine with name [...]", which names the engine but not the parameter, and an empty language renders the script as plain text. Partly covered, see below.| |
|[velocity|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/velocity/]|E2 errors|{{filter}}|filter="nosuchfilter", filter="Indent" with a wrong case and filter="a b" render as if the parameter was not set, with no message. Partly covered, see below.| |

h2. Impact found on macro fluidity
These
2 4 KOs come from the [WYSIWYG usability audit of the macros|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/], under the criterion criteria C4 input-assistance and E2 errors of its [usability criteria|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Usability%20criteria/]. The page of each macro, linked in the table, has the full notes and the steps to reproduce. Fixing them means changing the declaration of the parameters in the macro definitions.

The E2 errors KOs of script and velocity are only partly covered here, for the language and the filter. The same KOs also report other invalid values, covered by the other issues listed on the page of each macro, among them XCOMMONS-3847 for the conversion of the values and XRENDERING-823 for the wording of the error. The jars parameter of both is covered by XWIKI-25509 and by its own issue.