Document Tree Macro not open defined openTo after upgrade from xwiki15 to 16

Hi,

I’m using the DocumentTreeMacro for a custom navigation. With 15 everything is fine, but after upgrade to 16, it’s not open the related element from the “openTo” properties.

My implementation looks like this

#set ($openToDoc = $doc.documentReference.toString().replaceAll('([~"])', '~$1'))

... some user permission stuff

{{documentTree showTranslations="false" showWikiPrettyName="false" showAttachments="false" root="document:xwiki:${item}.WebHome" compact="true" showRoot="true" openTo="document:$openToDoc" limit="100"/}}

But with this, it’s only open the root (also there is a bug, for other elements I need to define expandToLevel="-1", or all elements would be already be open) and 1 level, nothing deeper.

When I define showRoot="false", it’s will open the tree until to the point from openTo, but then the root element is missing for the navigation.

Could not find any other information if something was changed.

Have now a workaround with this construction

        {{documentTree showTranslations="false" showAttachments="false" root="document:xwiki:${item}.WebHome" expandToLevel="-1" compact="true" showRoot="true" limit="100"/}}

        {{container cssClass="navcontainer"}}

        {{documentTree showTranslations="false" showAttachments="false" root="document:xwiki:${item}.WebHome" compact="true" showRoot="false" openTo="document:$openToDoc" limit="100"/}}

        {{/container}}

navcontainer → css with left margin to fit the style of a sub-menu.

But have this issue also in another xWiki I upgrade to 16 (but there I don’t need a custom navigation), but if showRoot is True and OpenTo defined, it’s breaks.