Skip to content
Snippets Groups Projects
Commit d109e3ae authored by Thomas Mortagne's avatar Thomas Mortagne
Browse files

XWIKI-15080: Chart macro is not putting the right document in the context

parent 93bd6ed6
No related branches found
No related tags found
No related merge requests found
......@@ -158,10 +158,12 @@ private XDOM computeXDOM(MacroTransformationContext context) throws MacroExecuti
xdom = context.getXDOM();
} else {
try {
DocumentModelBridge document = this.docBridge.getDocument(this.documentReference);
DocumentModelBridge document = this.docBridge.getDocumentInstance(this.documentReference);
DocumentDisplayerParameters parameters = new DocumentDisplayerParameters();
parameters.setContentTranslated(true);
parameters.setTargetSyntax(context.getTransformationContext().getTargetSyntax());
parameters.setContentTranslated(true);
xdom = this.documentDisplayer.display(document, parameters);
} catch (Exception e) {
throw new MacroExecutionException(String.format("Error getting Chart table from document [%s]",
......
......@@ -74,7 +74,7 @@ public void initialize(MockitoComponentManager componentManager) throws Exceptio
.thenReturn("temppath");
when(dab.getCurrentDocumentReference()).thenReturn(currentDocumentReference);
when(dab.exists(documentReference)).thenReturn(true);
when(dab.getDocument(documentReference)).thenReturn(document);
when(dab.getDocumentInstance(documentReference)).thenReturn(document);
when(dab.getCurrentUserReference()).thenReturn(null);
DocumentDisplayer displayer = componentManager.registerMockComponent(DocumentDisplayer.class);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment