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

Escaping of page references won't work in documentTree macro

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 16.2.0
    • Component
    • None
    • Windows 11, Ubuntu 22
    • Unknown

    Description

      I tried to exclude some pages in the Navigation and created my own Panel. Added the Following code to the default Navigation Panel:

      ## Exclude all pages below tag "hiddenSubpages"
      #set($hiddenSubpages = $services.query.xwql("from doc.object(XWiki.TagClass) as tag where 'hiddenSubpages' member of tag.tags").execute())
      #foreach($hiddenSubpage in $hiddenSubpages)
        #set ($hiddenSubpageWildCard = $hiddenSubpage.replaceAll(".WebHome$", ".%"))
        #set($children = $services.query.xwql("where doc.fullName like :name").bindValue("name", $hiddenSubpageWildCard).execute())
        #foreach($child in $children)
          #if($child != $hiddenSubpage)
            #set ($discard = $exclusions.add("document:" + $child.replaceAll(",", "\\,")))
          #end
        #end
      #end
         

      I tested it with the replace of "\\\\.", "\," "%2C" and without replace. In all versions of the macro, Pages with a comma are not filtered.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Zwixx Christian Fröhlich
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: