| The limit and offset parameters of the Live Data macro are numbers, but they declare no minimum: a negative limit is accepted by the Edit Macro dialog and shows "(No entries)", and nothing tells the user that the limit must be at least 1 and the offset at least 0. The fix is done in LiveDataMacroParameters.java:
- Declare @Min(1) on setLimit.
- Declare @Min(0) on setOffset.
XWIKI-25182 gives the numeric parameters a number field, which stops letters like "abc" from being typed, but not a negative value: that needs the minimum declared here. Depends on
- XWIKI-25287, without which the Edit Macro dialog does not enforce the declared minimum and the value is only checked when the macro is rendered.
KOs covered
| Macro |
Criterion |
Parameter |
Problem |
Depends on |
| liveData |
C13 constraints |
limit |
A number of entries, typed Integer, with no declared minimum: limit="-3" is accepted and shows "(No entries)", and limit="abc" is accepted and lists every entry in one page. |
XWIKI-25287 |
| liveData |
C13 constraints |
offset |
An index, typed Long, with no declared minimum: offset="abc" is accepted and ignored. |
XWIKI-25287 |
Impact found on macro fluidity These 2 KOs come from the WYSIWYG usability audit of the macros, under the criterion C13 constraints of its usability criteria. The page of the macro, linked in the table, has the full notes and the steps to reproduce. XWIKI-25182 covers their other part, the number field. |