Smarty Error when Processing ODT File, Maybe Tag
Overview
I'm trying to use the mail merge feature to generate a letter to send out about a scholarship. I uploaded a ODT file into the Message Templates as an option.
A test file is attached.Smarty_ODT_Template_Problem_CiviCRM.odt
I suspect it has something to do with the way quotes are interpretted in using the crmDate option of the time.
I tried with and without the new smarty option inside my civicrm.settings.php
file.
Reproduction steps
- Upload attached template to ** Administer > Communications > Message Tempaltes **.
- Go to a contact and click ** New Activity > Print/Mail merge**
- Select Template, click preview.
- Get error
Try new smarty
- In
civicrm.settings.php
add your definitiondefine('CIVICRM_SMARTY_AUTOLOAD_PATH', '/bitnami/wordpress/wp-content/plugins/civicrm/civicrm/packages/smarty4/vendor/autoload.php');
- repeat previous steps
- get an even harder error to process.
Current behaviour
What happens currently. Please provide error messages, screenshots or gifs (LICEcap, SilentCast) where appropriate.
With Smarty Autoload not defined.
Message was not parsed due to invalid smarty syntax : Smarty error: [in evaluated template line 4]: syntax error: unrecognized tag: domain.now|crmDate:"Full" (Smarty_Compiler.class.php, line 440)
After Defining smarty4
Message was not parsed due to invalid smarty syntax : Syntax error in template "eval:{crmScope extensionKey=""}<?xml version=..." on line 2 "<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:officeooo="http://openoffice.org/2009/office" office:version="1.3"><office:scripts/><office:font-face-decls><style:font-face style:name="Inter" svg:font-family="Inter" style:font-pitch="variable"/><style:font-face style:name="Inter SemiBold" svg:font-family="'Inter SemiBold'" style:font-pitch="variable"/><style:font-face style:name="Liberation Sans" svg:font-family="'Liberation Sans'" style:font-family-generic="swiss" style:font-pitch="variable"/><style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/><style:font-face style:name="Lucida Sans" svg:font-family="'Lucida Sans'" style:font-family-generic="swiss"/><style:font-face style:name="Lucida Sans1" svg:font-family="'Lucida Sans'" style:font-family-generic="system" style:font-pitch="variable"/><style:font-face style:name="Microsoft YaHei" svg:font-family="'Microsoft YaHei'" style:font-family-generic="system" style:font-pitch="variable"/><style:font-face style:name="NSimSun" svg:font-family="NSimSun" style:font-family-generic="system" style:font-pitch="variable"/><style:font-face style:name="OpenSymbol" svg:font-family="OpenSymbol" style:font-charset="x-symbol"/><style:font-face style:name="Roboto" svg:font-family="Roboto" style:font-adornments="Regular" style:font-pitch="variable"/></office:font-face-decls><office:automatic-styles><style:style style:name="Table1" style:family="table"><style:table-properties style:width="6.0903in" table:align="margins"/></style:style><style:style style:name="Table1.A" style:family="table-column"><style:table-column-properties style:column-width="2.0299in" style:rel-column-width="21845*"/></style:style><style:style style:name="Table1.A1" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="0.5pt solid #000000" fo:border-bottom="0.5pt solid #000000"/></style:style><style:style style:name="Table1.C1" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border="0.5pt solid #000000"/></style:style><style:style style:name="Table1.A2" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/></style:style><style:style style:name="Table1.C2" style:family="table-cell"><style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.5pt solid #000000" fo:border-right="0.5pt solid #000000" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/></style:style><style:style style:name="P1" style:family="paragraph" style:parent-style-name="Header"><style:text-properties officeooo:rsid="00053831" officeooo:paragraph-rsid="00053831"/></style:style><style:style style:name="P2" style:family="paragraph" style:parent-style-name="Header"><style:text-properties style:font-name="Inter" fo:font-size="8pt" officeooo:rsid="00053831" officeooo:paragraph-rsid="00053831"/></style:style><style:style style:name="P3" style:family="paragraph" style:parent-style-name="Header"><style:text-properties style:font-name="Inter SemiBold" officeooo:rsid="00034d11" officeooo:paragraph-rsid="00034d11"/></style:style><style:style style:name="P4" style:family="paragraph" style:parent-style-name="Standard"><style:text-properties officeooo:paragraph-rsid="00053831"/></style:style><style:style style:name="P5" style:family="paragraph" style:parent-style-name="Standard"><style:text-properties officeooo:rsid="00053831" officeooo:paragraph-rsid="00053831"/></style:style><style:style style:name="P6" style:family="paragraph" style:parent-style-name="Table_20_Contents"><style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/><style:text-properties fo:font-weight="bold" officeooo:rsid="00053831" officeooo:paragraph-rsid="00053831" style:font-weight-asian="bold" style:font-weight-complex="bold"/></style:style><style:style style:name="P7" style:family="paragraph" style:parent-style-name="Table_20_Contents" style:list-style-name="L1"><style:text-properties officeooo:rsid="00053831" officeooo:paragraph-rsid="00053831"/></style:style><style:style style:name="P8" style:family="paragraph"><loext:graphic-properties draw:fill-color="#2a6099"/><style:text-properties fo:font-size="12pt"/></style:style><style:style style:name="T1" style:family="text"><style:text-properties officeooo:rsid="00053831"/></style:style><style:style style:name="T2" style:family="text"><style:text-properties style:font-name="Inter" fo:font-size="8pt"/></style:style><style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics"><style:graphic-properties style:vertical-pos="top" style:vertical-rel="baseline" style:horizontal-pos="left" style:horizontal-rel="paragraph" style:mirror="none" fo:clip="rect(0in, 0in, 0in, 0in)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard"/></style:style><style:style style:name="fr2" style:family="graphic" style:parent-style-name="Graphics"><style:graphic-properties style:vertical-pos="from-top" style:vertical-rel="paragraph" style:horizontal-pos="from-left" style:horizontal-rel="paragraph" style:mirror="none" fo:clip="rect(0in, 0in, 0in, 0in)" draw:luminance="0%" draw:contrast="0%" draw:red="100%" draw:green="100%" draw:blue="100%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard"/></style:style><text:list-style style:name="L1"><text:list-level-style-bullet text:level="1" text:style-name="Bullet_20_Symbols" loext:num-list-format="%1%" text:bullet-char="•"><style:list-level-properties text:list-level-position-and-space-mode="label-alignment"><style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.5in" fo:text-indent="-0.25in" fo:margin-left="0.5in"/></style:list-level-properties></text:list-level-style-bullet><text:list-level-style-bullet text:level="2" text:style-name="Bullet_20_Symbols" loext:num-list-format="%2%" text:bullet-char="◦"><style:list-level-properties text:list-level-position-and-space-mode="label-alignment"><style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="0.75in" fo:text-indent="-0.25in" fo:margin-left="0.75in"/></style:list-level-properties></text:list-level-style-bullet><text:list-level-style-bullet text:level="3" text:style-name="Bullet_20_Symbols" loext:num-list-format="%3%" text:bullet-char="▪"><style:list-level-properties text:list-level-position-and-space-mode="label-alignment"><style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1in" fo:text-indent="-0.25in" fo:margin-left="1in"/></style:list-level-properties></text:list-level-style-bullet><text:list-level-style-bullet text:level="4" text:style-name="Bullet_20_Symbols" loext:num-list-format="%4%" text:bullet-char="•"><style:list-level-properties text:list-level-position-and-space-mode="label-alignment"><style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.25in" fo:text-indent="-0.25in" fo:margin-left="1.25in"/></style:list-level-properties></text:list-level-style-bullet><text:list-level-style-bullet text:level="5" text:style-name="Bullet_20_Symbols" loext:num-list-format="%5%" text:bullet-char="◦"><style:list-level-properties text:list-level-position-and-space-mode="label-alignment"><style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.5in" fo:text-indent="-0.25in" fo:margin-left="1.5in"/></style:list-level-properties></text:list-level-style-bullet><text:list-level-style-bullet text:level="6" text:style-name="Bullet_20_Symbols" loext:num-list-format="%6%" text:bullet-char="▪"><style:list-level-properties text:list-level-position-and-space-mode="label-alignment"><style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="1.75in" fo:text-indent="-0.25in" fo:margin-left="1.75in"/></style:list-level-properties></text:list-level-style-bullet><text:list-level-style-bullet text:level="7" text:style-name="Bullet_20_Symbols" loext:num-list-format="%7%" text:bullet-char="•"><style:list-level-properties text:list-level-position-and-space-mode="label-alignment"><style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2in" fo:text-indent="-0.25in" fo:margin-left="2in"/></style:list-level-properties></text:list-level-style-bullet><text:list-level-style-bullet text:level="8" text:style-name="Bullet_20_Symbols" loext:num-list-format="%8%" text:bullet-char="◦"><style:list-level-properties text:list-level-position-and-space-mode="label-alignment"><style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.25in" fo:text-indent="-0.25in" fo:margin-left="2.25in"/></style:list-level-properties></text:list-level-style-bullet><text:list-level-style-bullet text:level="9" text:style-name="Bullet_20_Symbols" loext:num-list-format="%9%" text:bullet-char="▪"><style:list-level-properties text:list-level-position-and-space-mode="label-alignment"><style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.5in" fo:text-indent="-0.25in" fo:margin-left="2.5in"/></style:list-level-properties></text:list-level-style-bullet><text:list-level-style-bullet text:level="10" text:style-name="Bullet_20_Symbols" loext:num-list-format="%10%" text:bullet-char="•"><style:list-level-properties text:list-level-position-and-space-mode="label-alignment"><style:list-level-label-alignment text:label-followed-by="listtab" text:list-tab-stop-position="2.75in" fo:text-indent="-0.25in" fo:margin-left="2.75in"/></style:list-level-properties></text:list-level-style-bullet></text:list-style><style:style style:name="gr1" style:family="graphic"><style:graphic-properties draw:fill-color="#2a6099" draw:textarea-horizontal-align="justify" draw:textarea-vertical-align="middle" draw:auto-grow-height="false" fo:min-height="10.9992in" fo:min-width="1.6083in" loext:decorative="false" style:run-through="foreground" style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:vertical-rel="paragraph" style:horizontal-pos="from-left" style:horizontal-rel="paragraph" draw:wrap-influence-on-position="once-concurrent" loext:allow-overlap="true" style:flow-with-text="false"/></style:style></office:automatic-styles><office:body><office:text><text:sequence-decls><text:sequence-decl text:display-outline-level="0" text:name="Illustration"/><text:sequence-decl text:display-outline-level="0" text:name="Table"/><text:sequence-decl text:display-outline-level="0" text:name="Text"/><text:sequence-decl text:display-outline-level="0" text:name="Drawing"/><text:sequence-decl text:display-outline-level="0" text:name="Figure"/></text:sequence-decls><text:p text:style-name="Standard">{domain.now|crmDate:"Full"}</text:p><text:p text:style-name="Standard">{capture assign=address2}{/capture}</text:p><text:p text:style-name="Standard">Jacob Clinton</text:p><text:p text:style-name="Standard">4529 Clear Lake{if $address2}</text:p><text:p text:style-name="Standard">{$address2}{/if}</text:p><text:p text:style-name="Standard">Mesquite, TX 75150</text:p><text:p text:style-name="Standard"/><text:p text:style-name="Standard">Dear Jacob,</text:p><text:p text:style-name="Standard"/><text:p text:style-name="Standard">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae libero efficitur, placerat magna eu, ultrices ipsum. Nunc a nisl sed ante ullamcorper convallis. Aenean quam nisi, viverra vitae orci in, vehicula rutrum lacus. Sed consectetur feugiat tristique. Suspendisse a ex sed sapien facilisis euismod sit amet a ipsum. Etiam dictum eros in rhoncus vestibulum. </text:p><text:p text:style-name="Standard"/><text:p text:style-name="Standard">Nunc interdum quam sed orci lobortis, ullamcorper scelerisque quam maximus. Donec id rhoncus nisi, at vestibulum quam. Donec laoreet convallis dolor ac malesuada. Curabitur sit amet porta diam, sed vehicula nisl. Sed metus neque, venenatis dapibus euismod nec, consectetur id justo. Nulla non auctor nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Aenean lorem lacus, feugiat id venenatis nec, viverra imperdiet est. </text:p><text:p text:style-name="Standard"/><text:p text:style-name="Standard">As of writing, you are eligible to receive a one-time scholarship of 1,200.00.</text:p><text:p text:style-name="Standard"/><text:p text:style-name="Standard">Etiam id elit quis libero ullamcorper pretium:</text:p><table:table table:name="Table1" table:style-name="Table1"><table:table-column table:style-name="Table1.A" table:number-columns-repeated="3"/><table:table-row><table:table-cell table:style-name="Table1.A1" office:value-type="string"><text:p text:style-name="P6">Option 1</text:p></table:table-cell><table:table-cell table:style-name="Table1.A1" office:value-type="string"><text:p text:style-name="P6">Option 2</text:p></table:table-cell><table:table-cell table:style-name="Table1.C1" office:value-type="string"><text:p text:style-name="P6">Option 3</text:p></table:table-cell></table:table-row><table:table-row><table:table-cell table:style-name="Table1.A2" office:value-type="string"><text:list text:style-name="L1"><text:list-item><text:p text:style-name="P7">Name</text:p></text:list-item><text:list-item><text:p text:style-name="P7">Contact</text:p></text:list-item><text:list-item><text:p text:style-name="P7">purpose</text:p></text:list-item></text:list></table:table-cell><table:table-cell table:style-name="Table1.A2" office:value-type="string"><text:list text:continue-numbering="true" text:style-name="L1"><text:list-item><text:p text:style-name="P7">Institution Name</text:p></text:list-item><text:list-item><text:p text:style-name="P7">ID Number</text:p></text:list-item><text:list-item><text:p text:style-name="P7">Semester</text:p></text:list-item><text:list-item><text:p text:style-name="P7"/></text:list-item></text:list></table:table-cell><table:table-cell table:style-name="Table1.C2" office:value-type="string"><text:list text:continue-numbering="true" text:style-name="L1"><text:list-item><text:p text:style-name="P7">Church Or Mission Sending Agency</text:p></text:list-item><text:list-item><text:p text:style-name="P7">Address</text:p></text:list-item><text:list-item><text:p text:style-name="P7">Contact</text:p></text:list-item></text:list></table:table-cell></table:table-row></table:table><text:p text:style-name="Standard"/><text:p text:style-name="P4">Curabitur sit amet porta diam, sed vehicula nisl. Sed metus neque, venenatis dapibus euismod nec, consectetur id justo. Nulla non auctor nisi. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Aenean lorem lacus, feugiat id venenatis nec, viverra imperdiet est. </text:p><text:p text:style-name="P4"/><text:p text:style-name="P5">You will be notified when your scholarship has been dispatched ot your institution.</text:p><text:p text:style-name="P5"/><text:p text:style-name="P5">Once more thanks for serving</text:p><text:p text:style-name="P5"/><text:p text:style-name="P5">Sincerley,</text:p><text:p text:style-name="P5"/><text:p text:style-name="P4"/><text:p text:style-name="P4"><draw:frame draw:style-name="fr1" draw:name="Image2" text:anchor-type="as-char" svg:width="1.378in" svg:height="1.1028in" draw:z-index="2"><draw:image xlink:href="Pictures/100003F800004240000035057DD467E7.svg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:mime-type="image/svg+xml"/><draw:image xlink:href="Pictures/100000010000028100000201E514FB0C.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:mime-type="image/png"/></draw:frame></text:p><text:p text:style-name="P5">First Last</text:p></office:text></office:body></office:document-content>{/crmScope}" - Unexpected ".", expected one of: "}"
Expected behaviour
What should happen. The intended goal:
Environment information
- Browser: Firefox
- CiviCRM: 5.73.1
- PHP: 8.1
- CMS: Wordpress 6.5.2
- Database: Maria 10.6.12
- Web Server: Apache
Comments
Anything else you would like the reviewer to note.
Edited by savionlee