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

During exports, "macros.vm" from "defaultbaseskin" is always used instead of the one from the current skin

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 6.3-milestone-2
    • 6.2-rc-1
    • Old Core
    • None
    • Unknown
    • N/A
    • N/A

    Description

      Problem: during the export, XWiki needs the Velocity Engine.
      In DefaultVelocityManager#getVelocityEngineCacheKey() tries to get the "macros.vm" of the current skin:

      // We need the path relative to the webapp's home folder so we need to remove all path before
      // the skins/ directory. This is a bit of a hack and should be improved with a proper api.
      String skinMacros = context.getWiki().getSkinFile("macros.vm", skin, context);
      

      But getSkinFile actually returns the URL to a temp file, because during the export action, the FileSystemURLFactory is used:

      /**
       * Special URL Factory used during exports, which stores referenced attachments and resources on the filesystem, in a
       * temporary folder, so that they can be included in the export result. The returned URLs point to these resources as
       * {@code file://} links, and not as {@code http://} links.
       */
      public class FileSystemURLFactory extends XWikiServletURLFactory
      

      Here, for the "macros.vm" special case, we should use the standard URL factory.

      Because of that problem, XWiki fallbacks to the "macros.vm" of the default base skin, even if the current skin has it own macros.vm.

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              gdelhumeau Guillaume Delhumeau
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: