This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-7641687b-c0a2-483d-bc13-8f0ea01d57b7 XWIKI-25586 Open

Declare the minimum of the limit and offset parameters of the Live Data macro

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-692828e7-530a-41ef-9caa-513ab5a9afb2 Charpentier Lucas created this issue on 23/Oct/26 17:30
 
Summary: Declare the minimum of the limit and offset parameters of the Live Data macro
Issue Type: cid:jira-generated-image-avatar-7641687b-c0a2-483d-bc13-8f0ea01d57b7 Improvement
Affects Versions: 17.10.14, 18.8.0
Assignee: Unassigned
Components: Live Data
Created: 23/Oct/26 17:30
Priority: cid:jira-generated-image-static-major-fc2678e6-02d2-432f-be6e-30c396fe8288 Major
Reporter: Charpentier Lucas
Description:

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.