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

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 9.8.1, 12.10.5
    • Fix Version/s: None
    • Component/s: Old Core, Panels
    • Labels:
      None
    • Difficulty:
      Unknown
    • Similar issues:

      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

          Activity

            People

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

              Dates

              Created:
              Updated:
              Date of First Response: