Details
-
Bug
-
Resolution: Unresolved
-
Major
-
17.10.0
-
None
-
Unknown
-
Description
Steps to reproduce
- Install a syntax extension on the main wiki only (not on the farm), for example the BlockNote syntax.
- In the wiki administration, set that syntax as the default page syntax.
- Import an office document (.odt, .docx) with the Office Importer application, without splitting it into child pages.
Expected result
The page is created with the content of the office document, in the default page syntax, and with the images of the document attached.
Actual result
The page is created with the default page syntax but its content is empty, and no image is attached. The import reports no error. The only trace is in the logs, when the Mentions indexer parses the new page:
com.xpn.xwiki.XWikiException: Error number 0 in 4: Failed to parse content of syntax [blocknote/1.0] ... Caused by: org.xwiki.rendering.parser.ParseException: The BlockNote root element must be a JSON array.
The same import works when the document is split into child pages.
Cause
DefaultXDOMOfficeDocumentBuilder passes the root component manager to XDOMOfficeDocument, whose getContentAsString(syntaxId) looks up the renderer there. The root component manager doesn't see the components of extensions installed on a wiki, so the lookup fails, getContentAsString returns null without logging anything, and ModelBridge saves that as the page content. DefaultOfficeDocumentSplitter and DefaultPresentationBuilder already use the context component manager, which is why the split import works.
A syntax installed on the farm (for example Markdown, which the Extension Manager installs on the farm) is registered in the root component manager, which hides the problem.
Attachments
Issue Links
- relates to
-
XWIKI-25463 Import content into BlockNote editor from office documents
-
- In Progress
-