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

Object properties display are not wrapped with {{html}} macros in panels when containing HTML

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 9.8.1, 12.10.5
    • Old Core, Panels
    • None
    • Unknown

    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:

      • html is displayed by the panel

      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.

      Attachments

        1. image-2021-06-16-20-02-38-002.png
          57 kB
          Anca Luca
        2. image-2021-06-16-20-03-13-912.png
          23 kB
          Anca Luca
        3. Screenshot 2021-08-27 at 17.13.56.png
          138 kB
          Vincent Massol
        4. Screenshot 2021-08-27 at 17.27.06.png
          325 kB
          Vincent Massol

        Activity

          People

            Unassigned Unassigned
            lucaa Anca Luca
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: