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

            Minh Tran added a comment -
            Atlassian update

            Thank you for taking the time to raise, comment or vote on this Bug. We regret to inform you that due to a limited number of reports and based on our current backlog of higher impact issues that we are closing this issue as Timed Out.
            If this issue is still impacting you on a recent version please feel free to comment with the affected version. Any further details you may be able to provide regarding reproduction or impact of this issue may help us better address this issue.
            Thanks again.
            Regards,
            Confluence Development

            Minh Tran added a comment - Atlassian update Thank you for taking the time to raise, comment or vote on this Bug. We regret to inform you that due to a limited number of reports and based on our current backlog of higher impact issues that we are closing this issue as Timed Out. If this issue is still impacting you on a recent version please feel free to comment with the affected version. Any further details you may be able to provide regarding reproduction or impact of this issue may help us better address this issue. Thanks again. Regards, Confluence Development

            Bump, this is still an issue, and the patch is still valid (although line numbers may have changed slightly). I have patched 4.2 today.

            daviderickson added a comment - Bump, this is still an issue, and the patch is still valid (although line numbers may have changed slightly). I have patched 4.2 today.

            while noodling around, I tried the #parse function even with a very simple html include file and that didn't work for me.

            Matthew J. Horn added a comment - while noodling around, I tried the #parse function even with a very simple html include file and that didn't work for me.

            Hi just following up to see if there is an ETA on integrating this patch? I checked with the 4.0 code base and it still applies with minor changes (velocity.properties moved to confluence-project/conf-webapp/src/main/resources/velocity.properties). This is a very simple bugfix with a given patch. For me having to recompile Confluence anytime a release comes out I want to deploy to include this patch is frustrating.

            Thanks-

            daviderickson added a comment - Hi just following up to see if there is an ETA on integrating this patch? I checked with the 4.0 code base and it still applies with minor changes (velocity.properties moved to confluence-project/conf-webapp/src/main/resources/velocity.properties). This is a very simple bugfix with a given patch. For me having to recompile Confluence anytime a release comes out I want to deploy to include this patch is frustrating. Thanks-

              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