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

Velocity error logged on every page view when a docextra UI extension doesn't define the itemnumber parameter

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A

    Description

      Steps to reproduce

      1. Create a page with an XWiki.UIExtensionClass object on the extension point org.xwiki.plaftorm.template.docextra, scope wiki, with the following parameters (note: no itemnumber):
        show=true
        title=Test
        name=test
        
      2. View any page.

      Expected

      The new tab is displayed at the bottom of the page without an item count, and nothing is logged. The extension point documentation lists itemnumber as optional.

      Actual

      The tab is displayed correctly, but every page view logs an error in the server logs, once per such tab:

      ERROR o.a.v.rendering - Left side ($docextra.get(3)) of comparison operation has null value at environment:/skins/flamingo/docextra.vm[line 95, column 55]
      

      The item count of a UI extension tab is taken from $params.itemnumber, which is null when the parameter is missing, and docextra.vm then compares it with >= 0.

      This also happens in the functional tests: the tabs created by DocExtraTabsIT don't define itemnumber, so every page view of the tests that run after it in xwiki-platform-flamingo-skin-test-docker logs this error.

      Attachments

        Issue Links

          Activity

            People

              surli Simon Urli
              surli Simon Urli
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: