-
Bug
-
Resolution: Incorrectly Filed
-
Low
-
None
-
7.13.16, 7.19.7, 7.19.8
-
None
-
3
-
Severity 3 - Minor
-
2
-
Problem
The Page Properties Report Macro does not render User Macros and will result in an NPE in the backend logs when workaround from CONFSERVER-82741 is being applied.
Environment
Issue reproduced locally in Confluence DC 7.19.7 and also in latest LTS (to date of Bug Report Creation) 7.19.8 and 7.13.16.
Steps to Reproduce
- Setup Confluence to start up with additional Catalina Options workaround taken from
CONFSERVER-82741e.g.CATALINA_OPTS="-Dmacro.required.velocity.context.keys=pageManager,spaceManager,attachmentManager,permissionHelper,userAccessor,i8n,dateFormatter,res,settingsManager,htmlUtil,generalUtil,bootstrap,containerContext,action,req,content ${CATALINA_OPTS}"
- Create some new User Macros examples of definitions per screenshots below
- Create a new page calling the Page Properties Macro. Storage Format Sample below
<p class="auto-cursor-target"><br /></p> <ac:structured-macro ac:name="details" ac:schema-version="1" ac:macro-id="49444b2d-d128-4233-a9d9-60c3f49586ca"> <ac:parameter ac:name="id">test</ac:parameter> <ac:rich-text-body> <p class="auto-cursor-target"><br /></p> <table class="fixed-width wrapped" style="width: 355.0px;"> <colgroup> <col style="width: 142.0px;" /> <col style="width: 355.0px;" /> </colgroup> <tbody> <tr> <th>testum1</th> <th>testum2</th> </tr> <tr> <td> <div class="content-wrapper"> <p> <ac:structured-macro ac:name="testum1" ac:schema-version="1" ac:macro-id="26a16bc1-0663-473b-9bac-925e71c96bbd" /> </p> </div> </td> <td> <div class="content-wrapper"> <p class="auto-cursor-target"><br /></p> <ac:structured-macro ac:name="testum2" ac:schema-version="1" ac:macro-id="f1a1824d-67ac-441f-898b-b9ed5472796c"> <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter> <ac:rich-text-body> <p><br /></p> </ac:rich-text-body> </ac:structured-macro> <p class="auto-cursor-target"><br /></p> </div> </td> </tr> </tbody> </table> <p class="auto-cursor-target"><br /></p> </ac:rich-text-body> </ac:structured-macro> <p class="auto-cursor-target"><br /></p>
- Example of how the Page Renders
- Example of how the Page Renders
- Add the label test to the page
- Create a new separate page and call the Page Properties Report Macro, storage format sample below
<p> <ac:structured-macro ac:macro-id="d82643d7-bba7-4d28-b337-c2220c45a5df" ac:name="detailssummary" ac:schema-version="2"> <ac:parameter ac:name="cql">label = "test" and space = currentSpace()</ac:parameter> </ac:structured-macro> </p>
Expected Results
The Page Properties Report macro should render well on this second page and we should see the user macros results e.g. without the Catalina Options here is how it is displayed:
Actual Results
The Page Properties Report macro does not render well. Null Errors in Rendering the User Macros are observed
The stack trace snippet below appears in the backend logs
[...]
2023-04-21 15:08:33,585 ERROR [DetailsSummaryBuilder:thread-3] [xhtml.view.macro.ViewMacroMarshaller] handleMacroExecutionException Error rendering macro: testum1
-- referer: confluenceBaseURL/pages/resumedraft.action?draftId=2785292&draftShareId=22d3f411-fa5a-49d9-94b7-eb215655cbc4& | url: /rest/tinymce/1/macro/preview | traceId: f7b90fa25e01d4b0 | userName: admin
java.lang.NullPointerException
at java.base/java.util.Objects.requireNonNull(Objects.java:221)
at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:178)
at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at com.atlassian.confluence.renderer.radeox.macros.MacroUtils.requiredVelocityContext(MacroUtils.java:49)
at com.atlassian.confluence.macro.GenericVelocityMacro.execute(GenericVelocityMacro.java:73)
at com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.executeMacro(ViewMacroMarshaller.java:226)
at com.atlassian.confluence.content.render.xhtml.view.macro.ViewMacroMarshaller.marshalInternal(ViewMacroMarshaller.java:147)
[...]
Workaround
N/A
Notes
Note that this problem has been observed only with the workaround from the aforementioned bug CONFSERVER-82741 in place
- is related to
-
CONFSERVER-82741 Variables in user macro are not resolved
- Closed