Uploaded image for project: 'JIRA Components'
  1. JIRA Components
  2. JIRA-122

The parameters Macro parameter silently mis-parses any separator other than a comma

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 8.3
    • JIRA Macro
    • None
    • Unknown

    Description

      Problem

      The parameters parameter of the jira Macro is typed as java.util.Properties and converted through the generic BeanUtils path (there is no dedicated Converter<Properties> in xwiki-commons), which only understands a comma as the pair separator.

      Anything else is accepted without any error: the whole string is parsed as a single name=value pair whose value is everything after the last =. The extra pairs are silently dropped and the field displayers just fall back to their defaults, so the page renders normally and the user gets no feedback at all.

      Verified by adding throwaway rendering test cases to jira-macro-default (removed afterwards):

      • parameters="field.url.label='custom label',aaa='1'" - both pairs parsed, in either order, and a space after the comma is tolerated.
      • the same string with |, a space, or ; in place of the comma - a single entry, no error.

      Impact

      The syntax was never documented (the @PropertyDescription only says "extra parameters for sources, displayers and field displayers"), so a wrong separator is an easy mistake to make and impossible to diagnose from the rendered page.

      Suggested fix

      Either reject unparseable input with a Macro execution error, or - at a minimum - state the format in the @PropertyDescription, which is what the WYSIWYG Macro editor shows the user.

      The documentation now describes it as "a comma-separated list of name=value pairs, values optionally single-quoted".

      Attachments

        Activity

          People

            Unassigned Unassigned
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: