Description
In order to reproduce, we can use the example of the rights class & object.
Steps to reproduce:
- create a simple panel, containing the following code (listing all users of all rights objects of the current page):
{{velocity}} #panelheader("Test property panel") #set ($rights = $doc.getObjects("XWiki.XWikiRights")) #foreach ($r in $rights) * Property test $doc.display('users', $r) #end #panelfooter() {{/velocity}}
- set this panel on a page or space
- add a rights object on the page, by setting rights to some user on the page only (using administration for a non-terminal page or the Edit->rights for a terminal page)
- render the page in view mode
Expected results:
- the list of users of the right object is rendered graphically in the panel
Actual results:
If the same script is added in the document content, the property is displayed properly:
Debugging shows that the variable isInRenderingEngine from line https://github.com/xwiki/xwiki-platform/blob/xwiki-platform-12.10.5/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java#L3437 is false for panels and true for documents content, thus the difference in behaviour. Not sure if it's intended or not (and the rules for writing panels are different than what I did), but feels like a bug to me.