10763346 by acetousk

Fix versionName bug

1 parent a1c1b3c8
...@@ -68,8 +68,8 @@ along with this software (see the LICENSE.md file). If not, see ...@@ -68,8 +68,8 @@ along with this software (see the LICENSE.md file). If not, see
68 grapesFile.putText(dataRaw) 68 grapesFile.putText(dataRaw)
69 grapesFile.move(grapesLocation) 69 grapesFile.move(grapesLocation)
70 ]]></script> 70 ]]></script>
71 <set field="htmlVersionName" from="htmlFile?.getCurrentVersion()?.getVersionName()"/> 71 <set field="htmlVersionName" from="htmlFile?.getCurrentVersion()?.getVersionName() ?: htmlFile?.getRootVersion()?.getVersionName() ?: '01'"/>
72 <set field="grapesVersionName" from="grapesFile?.getCurrentVersion()?.getVersionName()"/> 72 <set field="grapesVersionName" from="grapesFile?.getCurrentVersion()?.getVersionName() ?: grapesFile?.getRootVersion()?.getVersionName() ?: '01'"/>
73 <service-call name="update#moqui.basic.email.EmailTemplate" in-map="[emailTemplateId:emailTemplateId,grapesLocation:grapesLocation,htmlLocation:htmlLocation]"/> 73 <service-call name="update#moqui.basic.email.EmailTemplate" in-map="[emailTemplateId:emailTemplateId,grapesLocation:grapesLocation,htmlLocation:htmlLocation]"/>
74 74
75 <service-call name="mjml.MjmlServices.get#GlobalGrapeVarList" out-map="globalGrapeVarList"/> 75 <service-call name="mjml.MjmlServices.get#GlobalGrapeVarList" out-map="globalGrapeVarList"/>
...@@ -128,8 +128,10 @@ along with this software (see the LICENSE.md file). If not, see ...@@ -128,8 +128,10 @@ along with this software (see the LICENSE.md file). If not, see
128 <if condition="!grapesFile || grapesFile.parent?.location != grapesJsResource.location"> 128 <if condition="!grapesFile || grapesFile.parent?.location != grapesJsResource.location">
129 <return error="true" message="Resource not found"/> 129 <return error="true" message="Resource not found"/>
130 </if> 130 </if>
131 <set field="grapesVersionName" from="grapesFile?.getCurrentVersion()?.getVersionName()"/> 131 <set field="grapesVersionName" from="grapesFile?.getCurrentVersion()?.getVersionName() ?: grapesFile?.getRootVersion()?.getVersionName() ?: '01'"/>
132 <set field="htmlVersionName" from="ec.resource.getLocationReference(htmlLocation)?.getCurrentVersion()?.getVersionName()"/> 132 <set field="tempHtmlFile" from="ec.resource.getLocationReference(htmlLocation)"/>
133 <set field="htmlVersionName" from="tempHtmlFile?.getCurrentVersion()?.getVersionName() ?: tempHtmlFile?.getRootVersion()?.getVersionName() ?: '01'"/>
134 <set field="tempHtmlFile" from="null"/>
133 135
134 <service-call name="mjml.MjmlServices.get#GlobalGrapeVarList" out-map="globalGrapeVarList"/> 136 <service-call name="mjml.MjmlServices.get#GlobalGrapeVarList" out-map="globalGrapeVarList"/>
135 <set field="dataRaw" from="grapesFile.getText()"/> 137 <set field="dataRaw" from="grapesFile.getText()"/>
......