Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25586

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

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 17.10.14, 18.8.0
    • Live Data
    • None
    • Unknown

    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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Lucas C Charpentier Lucas
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: