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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.2-rc-1
    • Fix Version/s: 6.3-milestone-2
    • Component/s: Old Core
    • Labels:
      None
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      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

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

                Dates

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