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

Livetable location filtering doesn't always honor "/" in input

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0
    • Fix Version/s: 10.1-rc-1
    • Component/s: LiveTable
    • Labels:
      None
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      Right now if you have "Blog.BlogIntroduction", using "Blog/Intro" would match but it would also match "BlogForIntrospection" which isn't expected.

      Here's the code:

                ## Because the user might filter with "/" as separator we replace that by "%", because it could be "." 
                ## (the space separator) or "/" (as it is in the document name).
                ## In addition, using "%" (any sequence of character) instead of "_" (any single character) gives the ability
                ## to filter on different levels:
                ##   e.g. filtering on "Blog/Intro" will return "Blog.BlogIntroduction".
                ##        On the other hand, it will also returns: "BlogForIntrospection", which might be unexpected.
                #set ($locationFilterValue = $locationFilterValue.replaceAll('/', '%'))
      

      I'm proposing to change to:

      #set ($locationFilterValue = $locationFilterValue.replaceAll('/', '%.%'))
      

      The issue with the current code is that when using "/" it'll still return result even though there's no location path separator which is wrong.

        Attachments

          Activity

            People

            • Assignee:
              vmassol Vincent Massol
              Reporter:
              vmassol Vincent Massol
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: