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

Allow to specify empty string value in a StaticList with same separator

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 13.3-rc-1, 12.10.7
    • 12.10.5
    • Old Core
    • None
    • Unit
    • Unknown

    Description

      It's currently not possible to create multiple empty string values in a StaticList xproperty.
      For example with a StaticList xproperty defined with | as the only separator, the value ||s will create two values: an empty string, followed by a s, where we'd expect three values: two empty strings, followed by a s.

      This type of usecase should be allowed, but we need to be careful to handle properly usecases with several separators and whitespaces. For example if a space is considered as separator, multiple whitespaces between the values are probably not meaning several empty values between the values, but most probably a typo produced by the user.
      In the same way, by deault the separators used in static list are |, and space: it's common to have values such as Foo, Bar. In that case, we have , followed by a space, so two separators which could create and empty string value. This is actually a problem raised in XWIKI-17000 already so we need to be sure to not break this.
      More globally it seems better to only consider that an empty string is created if the same separator is used twice, so here's some examples when considering a StaticList xproperty with the 3 separators ,| and space:

      • a,b -> [a,b]
      • a,,b -> [a, ,b]
      • a,|b -> [a,b]
      • a , b -> [a,b]
      • a b -> [a,b]
      • a,||b -> [a,,b]

      Attachments

        Issue Links

          Activity

            People

              surli Simon Urli
              surli Simon Urli
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: