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

Don't force the skin action for some static resources

    XMLWordPrintable

Details

    • Unknown

    Description

      For example I've noticed that the following resources are pulled with forceSkinAction set to true:

      • In macros.vm
      #set ($url = $xwiki.getSkinFile('icons/xwiki/noavatar.png', true))
      
      • In Main.Activity lots of resources are pulled using the following (this leads for ex to icons/silk/page_white_add.png being loaded not as a static resource but through the skins action)
      $xwiki.getSkinFile($activityActionsMap.get($eventType), true)
      
      • In javascript.vm there are quite a lot of JS files pulled with forceSkinAction (and this is dangerous since velocity is applied!). For example:
      $xwiki.jsfx.use('js/scriptaculous/effects.js', true)##
      

      Note that one easy way to find out the full list is to put a conditional breakpoint in api/XWiki.java in the method "public String getSkinFile(String filename, String skin, boolean forceSkinAction, XWikiContext context)" on the following line:

      url = urlf.createResourceURL(filename, forceSkinAction, context);
      

      (put as condition for the breakpoint that forceSkinAction is true, and filename ends with "png", "js", etc)

      Attachments

        Activity

          People

            Unassigned Unassigned
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: