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

Macro editor fails to render parameter modal when a macro parameter uses a List<String> type with a non-empty default value and has a custom picker that usesĀ  select-multiple

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 15.0-rc-1, 15.10.16, 18.5.0, 16.10.18, 17.10.10
    • WYSIWYG Editor
    • None
    • Unknown

    Description

      The Macro Editor fails to render the parameter modal when a macro parameter uses a List<String> type with a non-empty default value and has a custom picker that uses select-multiple. This occurs because, in some cases, the serialized XML does not contain a value for the parameter, so the parameter's default value is used instead. In this case, the default value is an array, and attempting to call split on an array causes an error, which breaks the UI.

      Steps to reproduce:
      1. Define a java macro with a parameter that uses a List<String> as the type and has a default value
      2. Add a custom multi picker.
      3. Add the macro in the page

      EXPECTED RESULTS: The modal is rendered and I can edit my parameters

      ACTUAL RESULTS: The modal shows an error.

      Attachments

        Activity

          People

            Farcasut Farcasi Alexandru-Vicentiu
            Farcasut Farcasi Alexandru-Vicentiu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: