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

WebJars URLs should target the current wiki by default + support relative paths

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 7.4-milestone-2, 7.1.4
    • Fix Version/s: 7.4.3, 8.1-milestone-2
    • Component/s: Webjar
    • Labels:
      None
    • Tests:
      Unit, Integration
    • Difficulty:
      Easy
    • Similar issues:

      Description

      With XWIKI-12878 we can specify the wiki in the WebJar URL. The problem is that loading a resource from a WebJar installed on the current wiki is the most common use case which means that now we have to write:

      $services.webjars.url('org.xwiki.contrib:application-ckeditor-webjar', 'ckeditor.js', {'wiki': $xcontext.database})
      

      all the time if you want to make sure your code works on a sub-wiki too. I think the webjar script service should do this by default, and we should make sure that

      /xwiki/webjars/application-ckeditor-webjar/1.4/ckeditor.js?wiki=chess
      

      fallsback on the main wiki and then on the farm if the WebJar is not installed on the sub-wiki.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vmassol Vincent Massol
                Reporter:
                mflorea Marius Dumitru Florea
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

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