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

Using a template to create a page which contains any variable and an EMPTY HTML macro results in "Oops - an error has occurred"

      Issue Summary

      This is reproducible on Data Center: Yes

      Steps to Reproduce

      • Browse to General Configuration > Global Templates and Blueprints > Add global page template
      • Add any variable to the page and an empty HTML Macro.
      • Save the template, and use it to create a new page.

      Expected Results

      You will see the editor and be able to use the template and create a new page.

      Actual Results

      You are brought to an error page, "Oops - an error has occurred". There is no stack trace on this page, but there is in the logs.

      The below exception is thrown in the atlassian-confluence.log file:

      2023-12-09 11:22:12,357 ERROR [http-nio-8090-exec-20] url: /pages/createpage-entervariables.action; user: admin] [apache.struts2.result.VelocityResult] doExecute Unable to render velocity template: '/pages/createpage-entervariables.vm'
       -- url: /pages/createpage-entervariables.action | userName: admin | action: createpage-entervariables | referer: https://test.confluence.com/dashboard.action | traceId: 
      org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getRenderedTemplateContent' in  class com.atlassian.confluence.pages.actions.PageVariablesAction threw exception java.lang.NullPointerException at /pages/createpage-entervariables.vm[line 19, column 51]
      	at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:228)
      	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
      

      Workaround

      Currently there is no known workaround for this behavior, but adding any content to the html macro resolves the issue.

            [CONFSERVER-93641] Using a template to create a page which contains any variable and an EMPTY HTML macro results in "Oops - an error has occurred"

            There are no comments yet on this issue.

              Unassigned Unassigned
              mrawson Miranda Rawson
              Affected customers:
              5 This affects my team
              Watchers:
              6 Start watching this issue

                Created:
                Updated: