Print/Merge produces blank results when using a docx or odt template file
Overview
When trying to generate thank you letters or other printed/merged documents, and when uploading a .docx or .odt template file to use, CiviCRM generates blank output (e.g. a blank PDF file, a blank .docx file). When generating the same document without uploading a template file, CiviCRM successfully generates output that contains the desired document body.
Reproduction steps
- Find one or more contacts, or contributions, or other entities that can be printed/merged
- Select an action that involves print/merge (e.g. thank you letters)
- Upload a template document to use for the printed/merged output, in .odt or .docx format
- Generate the merged document in any format (pdf, docx, html, odt)
- Observe that the resulting document is blank
Expected behaviour
When a merged/generated document is produced, it should use the uploaded template and the specified document body, and not be blank.
Environment information
- Browser: Attempted with Safari 15.1 and Chrome 96.0.4664.27 on macOS
- CiviCRM: 5.42.0
- PHP: 7.4
- CMS: WordPress 5.8.1