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

XWIKI-19205: The configured entry type is not taken into account to select the XWikiDocumentMerger

* fix a mistake
parent b78e90f1
No related branches found
No related tags found
No related merge requests found
......@@ -87,16 +87,21 @@ public void importDocument(String comment, XWikiDocument previousDocument, XWiki
String reference = "document:" + this.referenceSerializer.serialize(xarEntry);
// Resolve the type
type = this.typeResolver.resolve(xarEntry, false);
XarEntryType configuredType = this.typeResolver.resolve(xarEntry, false);
// Try a merger specific to the type name
if (type != null && componentManager.hasComponent(XWikiDocumentMerger.class, type.getName())) {
// Try a merger specific to the entry type
merger = componentManager.getInstance(XWikiDocumentMerger.class, type.getName());
if (configuredType != null
&& componentManager.hasComponent(XWikiDocumentMerger.class, configuredType.getName())) {
// Try a merger specific to the XAR entry type
merger = componentManager.getInstance(XWikiDocumentMerger.class, configuredType.getName());
} else if (componentManager.hasComponent(XWikiDocumentMerger.class, reference)) {
// Try a merger specific to the document reference
merger = componentManager.getInstance(XWikiDocumentMerger.class, reference);
}
if (configuredType != null) {
type = configuredType;
}
}
XWikiDocumentMergerConfiguration mergeConfiguration = new XWikiDocumentMergerConfiguration();
......
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