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

Flamingo skin uses jQuery UI without dependency or path declaration

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 17.10.13
    • 17.3.0-rc-1
    • Flamingo Skin
    • None
    • Unknown
    • N/A
    • N/A

    Description

      This issue cannot be reproduced in a regular XWiki instance but on an integration test instance, e.g., for xwiki-platform-notifications-test-docker and xwiki-platform-xclass-test-docker that doesn't include the Panel UI extension, an error like

      Loading failed for the <script> with source “http://localhost:8080/xwiki/bin/view/Main/jquery-ui.js 

      or also

      Uncaught Error: Script error for "jquery-ui"
        https://requirejs.org/docs/errors.html#scripterror
            makeError require.min.js:5
            onScriptError require.min.js:5
            load require.min.js:5
            load require.min.js:5
            load require.min.js:5
            fetch require.min.js:5
            check require.min.js:5
            enable require.min.js:5
            enable require.min.js:5
            enable require.min.js:5
            bind require.min.js:5
            each require.min.js:5
            enable require.min.js:5
            init require.min.js:5
            s require.min.js:5
            setTimeout handler*req.nextTick< require.min.js:5
            s require.min.js:5
            requirejs require.min.js:5
            <anonymous> flamingo.js:128 

      is shown. This also causes test failures, e.g., of org.xwiki.platform.notifications.test.ui.AllIT$NestedNotificationsIT#notificationDisplayerClass, in particular with Firefox 153 as there is a race between dataeditors.js and flamingo.js, while the former correctly declares the path, the latter doesn't and thus causes a load failure for jQuery which is persisted and then makes the object editor fail to load.

      flamingo.js requires 'jquery-ui' but the RequireJS path for it was only declared by the PanelsCode.RequireJSConfig UI extension shipped in the panels XAR, which the skin does not depend on. On an instance where that XAR is not installed - for instance the docker test instances of xwiki-platform-notifications-test-docker and xwiki-platform-xclass-test-docker - RequireJS resolved the module against the base URL, got a 404 and left it in a permanent error state, so every later consumer failed to initialise. Among them dataeditors.js, whose add object and add property click handlers were then never bound: clicking the buttons submitted the form instead, which leaves the editor and made ClassSheetIT and NotificationsIT flicker.

      From what I can see in the code, this is a regression introduced by XWIKI-22727.

      This issue is solved by XWIKI-23979 for XWiki versions starting with 18.2.0RC1, this issue is only about backporting the changes that are independent of the jQuery upgrade to 17.10.x.

      Attachments

        Issue Links

          Activity

            People

              MichaelHamann Michael Hamann
              MichaelHamann Michael Hamann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: