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

When a ssx / jsx is included manually with prefixed full name and also included with "always on this wiki" then it is actually included twice

    XMLWordPrintable

Details

    • Unknown
    • N/A
    • N/A

    Description

      I had this issue on a multiwiki environment but I reproduced it in a single wiki environment as well. To reproduce:
      1/ create a jsx extension with include="always on this wiki", say MySpace.MyJSX
      2/ create a page in the wiki where you use the extension manually with

      $xwiki.jsx.use('wikiname:MySpace.MyJSX')

      When visualizing the page (and page source), you'll see that the element

      <script type='text/javascript' src='/xwiki/wiki/wikiname/jsx/MySpace/MyJSX' defer='defer'></script>
      

      actually appears twice.

      This is caused because the deduplication on the ssx plugin side is done based on document fullname and while for the always used extensions this is MySpace.MyJSX, the manual one was containing a wiki name as well.

      Also note that if the full prefixed document reference is invalid (points to an inexistent wiki) – for example in single wiki mode – the manual include still works, generating a correct link to the current wiki, and the deduplication still doesn't work.

      Deduplication could also be done based on resources urls rather than names.

      Attachments

        Issue Links

          Activity

            People

              sdumitriu Sergiu Dumitriu
              lucaa Anca Luca
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: