XWiki Platform
  1. XWiki Platform
  2. XWIKI-4904

Custom displayers in syntax 2.0 cannot access their variables

    Details

    • Difficulty:
      Unknown
    • Similar issues:

      Description

      The displayCustom function in http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki//objects/classes/PropertyClass.java
      sets the velocity variables $name $prefix $object

      In syntax 1.0/XWiki 1.8.4 you could access these in your custom displayer code.

      In syntax 2.0 it seems you cannot access them directly.
      In xwiki 2.1.1 you can use $context.vcontext.name
      In xwiki.2.2 even that call does not work

      However if previous velocity has set these variables then it works. It seems the particular velocity context used in displayCustom is ignored.

        Activity

        Hide
        Ludovic Dubost added a comment -

        We need to upgrade that bug.. It's becoming very annoying to not be able to work with custom displayer.
        Another issue is that custom displayer do not work with Livetables

        Show
        Ludovic Dubost added a comment - We need to upgrade that bug.. It's becoming very annoying to not be able to work with custom displayer. Another issue is that custom displayer do not work with Livetables
        Hide
        Ludovic Dubost added a comment -

        Proposed patch for custom displayer.

        It is using the class syntax to decide how to parse the custom displayer field.
        The change for syntax 2.0 is to have a working solution.
        The change for syntax 1.0 is to go beyond only velocity parsing but also wiki parsing. Impact is not clear yet.

        Show
        Ludovic Dubost added a comment - Proposed patch for custom displayer. It is using the class syntax to decide how to parse the custom displayer field. The change for syntax 2.0 is to have a working solution. The change for syntax 1.0 is to go beyond only velocity parsing but also wiki parsing. Impact is not clear yet.
        Hide
        Sergiu Dumitriu added a comment -

        Fixed in r33759.

        Show
        Sergiu Dumitriu added a comment - Fixed in r33759.

          People

          • Assignee:
            Sergiu Dumitriu
            Reporter:
            Ludovic Dubost
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Date of First Response: