XWiki Platform
  1. XWiki Platform
  2. XWIKI-14008

Navigation panel does not take into account the current page anymore

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 9.0
    • Fix Version/s: 9.1-rc-1
    • Component/s: Index, Panels, Rendering
    • Labels:
    • Environment:
      Ubuntu 16.04
    • Tests:
      Unit
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      Hello,

      I've updated from version 8.4.4 (installed from the official Ubuntu Package repository) to the 9.0 (using apt-get) on a Ubuntu 16.04 system. Xwiki is running on Tomcat 8 and uses MySQL.

      After the installation wizard, I've been redirected to the Main page, where I could still see the navigation tree on the navigation Pane, with only the first level pages. All the other pages (depth > 1 where 1 = Main page level) is lost.

      When I try to reach the page from the direct link, I still see the page and I can also edit it.

      Seems like I'm missing the tree structure on the Navigation pane.

      Someone with the same problem?

      Note: Entering the page with direct link, I can see the correct breadcrumb: Home > Root Page > Second Page

      Thanks guys.

        Issue Links

          Activity

          Hide
          Thomas Mortagne added a comment - - edited

          I can reproduce it with the jetty/hsqldb package. Looks like selecting a branch in the tree does not work anymore.

          To reproduce:

          • download jetty/hsqldb package 9.0
          • start it and look at "Navigation" panel on the left

          -> the current space is not selected anymore in the tree and you don't see siblings

          Show
          Thomas Mortagne added a comment - - edited I can reproduce it with the jetty/hsqldb package. Looks like selecting a branch in the tree does not work anymore. To reproduce: download jetty/hsqldb package 9.0 start it and look at "Navigation" panel on the left -> the current space is not selected anymore in the tree and you don't see siblings
          Hide
          Marius Dumitru Florea added a comment - - edited

          Regression caused by XWIKI-13990. The Document Tree macro uses this code to collect the parameters:

          #set ($options = {})
          #foreach ($parameterName in $xcontext.macro.params.parameterNames)
            #set ($discard = $options.put($parameterName, $xcontext.macro.params.get($parameterName)))
          #end
          

          Before XWIKI-13990 the parameter names were exactly as they were defined in the XWiki.WikiMacroParameterClass objects, for instance using camelcase. After XWIKI-13990 the returned parameter names are all lowercase.

          The Document Tree macro uses this map of options (created from the macro parameters) in lots of places so updating each of these places to use the lowercase version of the parameter name is out of discussion. The only acceptable solution is to build the map of options using the actual macro parameter names.

          #set ($options = {})
          #foreach ($parameterName in $xcontext.macro.params.parameterNames)
            #set ($actualParameterName = ???)
            #set ($discard = $options.put($actualParameterName, $xcontext.macro.params.get($parameterName)))
          #end
          

          But the problem is that I don't have access to the macro descriptor from the macro code, except if I use PR (through $services.component).

          Show
          Marius Dumitru Florea added a comment - - edited Regression caused by XWIKI-13990 . The Document Tree macro uses this code to collect the parameters: #set ($options = {}) #foreach ($parameterName in $xcontext.macro.params.parameterNames) #set ($discard = $options.put($parameterName, $xcontext.macro.params.get($parameterName))) #end Before XWIKI-13990 the parameter names were exactly as they were defined in the XWiki.WikiMacroParameterClass objects, for instance using camelcase . After XWIKI-13990 the returned parameter names are all lowercase . The Document Tree macro uses this map of options (created from the macro parameters) in lots of places so updating each of these places to use the lowercase version of the parameter name is out of discussion. The only acceptable solution is to build the map of options using the actual macro parameter names. #set ($options = {}) #foreach ($parameterName in $xcontext.macro.params.parameterNames) #set ($actualParameterName = ???) #set ($discard = $options.put($actualParameterName, $xcontext.macro.params.get($parameterName))) #end But the problem is that I don't have access to the macro descriptor from the macro code, except if I use PR (through $services.component ).
          Hide
          Iacopo Palazzi added a comment - - edited

          Thanks a lot for the feedback.

          I see that the fix is already present on version 9.0.1 and 9.1, but consider that I've installed the 9.0 from deb http://maven.xwiki.org stable/ (that is not so stable indeed).

          I would like to use the package way to upgrade stuff for a standardize procedure approach, do you know when will it be upgradable to a fixed version using apt?

          Thank you guys.

          Show
          Iacopo Palazzi added a comment - - edited Thanks a lot for the feedback. I see that the fix is already present on version 9.0.1 and 9.1, but consider that I've installed the 9.0 from deb http://maven.xwiki.org stable/ (that is not so stable indeed). I would like to use the package way to upgrade stuff for a standardize procedure approach, do you know when will it be upgradable to a fixed version using apt? Thank you guys.
          Hide
          Vincent Massol added a comment -

          Note: we need a functional test to validate that the nav panel works fine.

          Show
          Vincent Massol added a comment - Note: we need a functional test to validate that the nav panel works fine.
          Hide
          Vincent Massol added a comment -

          Iacopo Palazzi The issue is not fixed yet.

          Show
          Vincent Massol added a comment - Iacopo Palazzi The issue is not fixed yet.
          Hide
          Thomas Mortagne added a comment -

          I see that the fix is already present on version 9.0.1 and 9.1

          No that's where is WILL BE fixed but it's not yet the case. Basically it means it's forbidden to release 9.0.1 or 9.1 without that.

          Show
          Thomas Mortagne added a comment - I see that the fix is already present on version 9.0.1 and 9.1 No that's where is WILL BE fixed but it's not yet the case. Basically it means it's forbidden to release 9.0.1 or 9.1 without that.
          Hide
          Thomas Mortagne added a comment -

          The Document Tree macro uses this code to collect the parameters:

          I was not expecting this use case. I tough wiki macros would just use $xcontext.macro.params.myParam. I will refactor WikiMacroParameters to have getParameterNames() always return the source parameters names instead of the internal map keys.

          I don't have access to the macro descriptor from the macro code

          Indeed wiki macro does not seems to provide the macro descriptor in the context.

          Show
          Thomas Mortagne added a comment - The Document Tree macro uses this code to collect the parameters: I was not expecting this use case. I tough wiki macros would just use $xcontext.macro.params.myParam. I will refactor WikiMacroParameters to have getParameterNames() always return the source parameters names instead of the internal map keys. I don't have access to the macro descriptor from the macro code Indeed wiki macro does not seems to provide the macro descriptor in the context.
          Hide
          Thomas Mortagne added a comment -

          Iacopo Palazzi while waiting for a new release what you can do is replace your /usr/lib/xwiki//WEB-INF/lib/xwiki-platform-rendering-wikimacro-api-9.0.jar file by the last one on http://maven.xwiki.org/snapshots/org/xwiki/platform/xwiki-platform-rendering-wikimacro-api/9.0.1-SNAPSHOT/

          Show
          Thomas Mortagne added a comment - Iacopo Palazzi while waiting for a new release what you can do is replace your /usr/lib/xwiki//WEB-INF/lib/xwiki-platform-rendering-wikimacro-api-9.0.jar file by the last one on http://maven.xwiki.org/snapshots/org/xwiki/platform/xwiki-platform-rendering-wikimacro-api/9.0.1-SNAPSHOT/
          Hide
          Alexey added a comment - - edited

          Thank you for the workaround!

          Show
          Alexey added a comment - - edited Thank you for the workaround!

            People

            • Assignee:
              Thomas Mortagne
              Reporter:
              Iacopo Palazzi
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

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