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

The rendering order of UI extensions in Flamingo's org.xwiki.plaftorm.menu.content UIXP is not deterministic

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • 14.4.1
    • Flamingo Skin, UI Extension
    • None
    • Easy

    Description

      If several UI extensions are inserted at `org.xwiki.plaftorm.menu.content`, they are executed in a non deterministic order.

      They are inserted at the right place with respect to their order property, but they are not necessarily rendered in this order. This can be noticed if two UIX are not independent. The documentation makes no promise about this aspect, but this behavior can still be surprising.

      This happens in macro displaySecureUIX, where extensions are retreived using $services.uix.getExtensions, browsed in a #foreach loop and rendered right away.

      We might want to order them according to their order property before looping over them.

      This can be reproduced by creating a page defining two UI Extensions with different orders and with a Wiki scope. One calls xcontext.put("executed", true). The order calls xcontext.get("executed"). This page can be put the main wiki and in other in a sub wiki.

      This is not an issue in most situations where UI extensions are independent but a deterministic rendering order is probably more robust.

      Initially discussed in the Matrix #xwiki channel between 11h52 and 12h02 FR time on the 28th of June 2022

      Attachments

        Activity

          People

            Unassigned Unassigned
            rjakse Raphaël Jakse
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: