Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-711

WikiMacro parameters are wrongly set to their default value, depending of their order in macro call

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 15.3-rc-1, 14.10.8
    • 14.10.7
    • Wikimodel
    • None
    • Unit
    • Unknown
    • N/A
    • N/A

    Description

      Here is a weird bug with wikimacro parameters: depending of the order they are declared in the macro call, they do or do not fallback to their default value.
      For example, a macro with 3 parameters:

      • pattern
      • sortyBy (with default "date")
      • sortOrder (with default "descending")

      calling this macro like so

      {{bug
        patterns=".*jpeg"
        sortBy="size"
        sortOrder="descending"
      /}}
      

      would give:

      patterns: .*jpeg
      sortBy: date
      sortOrder: descending 

      whereas

      {{bug
        sortBy="size"
        patterns=".*jpeg"
        sortOrder="descending"
      /}}
      

      would show:

      patterns: $wikimacro.parameters.patterns
      sortBy: size
      sortOrder: descending
      

      Strangely enough, the sortOrder parameter is never set to its default value, whatever its order is.

       

      You can find attached to the ticket a minimal reproduction page for this issue. Just call the macro like the one of the examples above.

      Attachments

        1. Bug.xml
          17 kB
          Clément Desableau
        2. Sandbox.Bug.xar
          3 kB
          Clément Desableau

        Activity

          People

            tmortagne Thomas Mortagne
            cdesableau Clément Desableau
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: