Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-22849

[PATCH included] Unable to use Velocity include function from site layouts

      Currently Confluence users are unable to use the #include Velocity function to include files into the rendered html via the Administrator site layouts area. My use case is I have a standard header across multiple products (Confluence, Jira, Fisheye/Crucible, IP.Board), and I want to directly include it from a file shared across all products, so if I change that one file it will update everywhere. The workaround was to use #parse, but parse interprets statements in the file as Velocity code, which is problematic if your html/javascript contains statements that are similar to Velocity.

      I've attached a patch that fixes this from Confluence 3.5.1-3.5.7(current), the problem is twofold:
      1- There is no included file resource loader in Velocity's config, an easy addition to the properties file
      2- There is a bug in the Hibernate resource loader that returns null instead of ResourceNotFoundException when it cannot find a resource in the database, preventing Velocity from falling through to the next resource loader. Easy and tested fix.

            [CONFSERVER-22849] [PATCH included] Unable to use Velocity include function from site layouts

            Katherine Yabut made changes -
            Workflow Original: JAC Bug Workflow v3 [ 2875167 ] New: CONFSERVER Bug Workflow v4 [ 3004940 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow v2 [ 2803791 ] New: JAC Bug Workflow v3 [ 2875167 ]
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow [ 2714541 ] New: JAC Bug Workflow v2 [ 2803791 ]
            Owen made changes -
            Symptom Severity Original: Minor [ 14432 ] New: Severity 3 - Minor [ 15832 ]
            Owen made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2380352 ] New: JAC Bug Workflow [ 2714541 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 [ 2299514 ] New: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2380352 ]
            Michael Andreacchio made changes -
            UIS Original: 1
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5.1 - TEMP [ 2233954 ] New: Confluence Workflow - Public Facing - Restricted v5 [ 2299514 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2195802 ] New: Confluence Workflow - Public Facing - Restricted v5.1 - TEMP [ 2233954 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 [ 1942464 ] New: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2195802 ]

              Unassigned Unassigned
              6c80a78e94f3 daviderickson
              Affected customers:
              1 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 0.5h
                  0.5h
                  Remaining:
                  Remaining Estimate - 0.5h
                  0.5h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified