Confluence 8 Web-item could not order following the "weight"

Hi all,
Our app was compatible with Confluence 7. And the order of web-item following the weight in the “atlassian-plugin.xml” file. Like this:
image
After update the app compatible with Confluence 8. And the “atlassian-plugin.xml” is the same, but the order of web-item was changed.
image

<!-- Web Items -->
  <web-item key="configuration" name="configuration" section="system.admin/ppp_section"
    weight="100">
    <label>Configuration</label>
    <link linkId="configuration-link">
      /plugins/servlet/ppp/configuration
    </link>
  </web-item>

  <web-item key="export" name="Export Permission" section="system.admin/ppp_section" weight="200">
    <label>Backup</label>
    <link linkId="export-configuration-link">
      /plugins/servlet/ppp/export
    </link>
  </web-item>

  <web-item key="import" name="Import Permission" section="system.admin/ppp_section" weight="300">
    <label>Restore</label>
    <link linkId="import-configuration-link">
      /plugins/servlet/ppp/import
    </link>
  </web-item>

  <web-item key="audit-log" name="Audit Log" section="system.admin/ppp_section" weight="400">
    <label>Audit Log</label>
    <link linkId="audit-log-link">
      /plugins/servlet/ppp/audit-log
    </link>
  </web-item>

Do you have any idea about it?
Thank you so much

We have the same problem. Looks to me like a bug in the decorator admin.vmd.

The macro #menuMacros_renderLeftNavMenu(…) is called up here, which is located in menu-macros.vm.

Here the items are sorted:

#foreach ($itemLabel in $generalUtil.sortList($displayableItemsLabelsList))

$generalUtil is of type com.atlassian.confluence.util.SafeGeneralUtil

And here the sort method sorts alphabetically without taking the weighting into account:

/**
     * Sorts a list of strings alphabetically in ascending order without the mutating original list.
     * @param list a list of strings
     * @return the list sorted alphabetically
     */
    public static List<String> sortList(List<String> list) {
        List<String> newList = new ArrayList<>(list);
        Collections.sort(newList);
        return newList;
    }

The only solution we have found so far: Write your own decorator and adapt the corresponding method.

Maybe someone else has a better solution…