There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-d865d37b-4c06-4eee-8efa-a68a1b574827 XWIKI-22751 Open

Escaping of page references won't work in documentTree macro

 
View issue   ·   Add comment
 

1 update

 
cid:jira-generated-image-avatar-db812859-cca9-4700-b1eb-0209d1049d1b Changes by Christian Fröhlich on 02/Jan/25 21:23
 
Description: I tried to exclude some pages in the Navigation and created my own Panel. Added the Following code to the default Navigation Panel:
{code:java}
## 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
  {code}
I tested it with the replace of "\\\\.", "\," "%2C" and without replace. In all versions of the macro, Pages with a comma are not filtered.