75bb67c2 by acetousk

Bug fix: force#DiskToDbResourceAndPublish

1 parent ba1567f1
...@@ -683,10 +683,15 @@ Find the email templates in the productStore, for each email template in the pro ...@@ -683,10 +683,15 @@ Find the email templates in the productStore, for each email template in the pro
683 <set field="dbResourceToUpdateText" from="dbResourceToUpdate.getText()"/> 683 <set field="dbResourceToUpdateText" from="dbResourceToUpdate.getText()"/>
684 <set field="childText" from="child.getText()"/> 684 <set field="childText" from="child.getText()"/>
685 685
686 <set field="updatedText" from="false"/>
686 <if condition="dbResourceToUpdateText != childText"><then> 687 <if condition="dbResourceToUpdateText != childText"><then>
687 <script><![CDATA[ 688 <script><![CDATA[
688 dbResourceToUpdate.putText(childText) 689 dbResourceToUpdate.putText(childText)
690 updatedText = true
689 ]]></script> 691 ]]></script>
692 </then><else>
693 </else></if>
694
690 <set field="versionName" from="dbResourceToUpdate.getCurrentVersion()?.getVersionName()"/> 695 <set field="versionName" from="dbResourceToUpdate.getCurrentVersion()?.getVersionName()"/>
691 <if condition="!versionName"> 696 <if condition="!versionName">
692 <log level="warn" message="No version name found for dbresource ${dbResourceToUpdate.location}"/> 697 <log level="warn" message="No version name found for dbresource ${dbResourceToUpdate.location}"/>
...@@ -708,26 +713,21 @@ Find the email templates in the productStore, for each email template in the pro ...@@ -708,26 +713,21 @@ Find the email templates in the productStore, for each email template in the pro
708 713
709 <iterate list="emailTemplateList" entry="emailTemplate"> 714 <iterate list="emailTemplateList" entry="emailTemplate">
710 <set field="logText" value="At emailTemplate ${emailTemplate.emailTemplateId},"/> 715 <set field="logText" value="At emailTemplate ${emailTemplate.emailTemplateId},"/>
711 <if condition="emailTemplate.grapesLocation == dbResourceToUpdate.location"> 716 <if condition="emailTemplate.grapesLocation == dbResourceToUpdate.location &amp;&amp; emailTemplate.grapesPublishedVersionName != versionName">
712 <set field="emailTemplate.grapesPublishedVersionName" from="versionName"/> 717 <set field="emailTemplate.grapesPublishedVersionName" from="versionName"/>
713 <set field="updatedEmailTemplateList" from="updatedEmailTemplateList + [emailTemplate:emailTemplate,location:emailTemplate.grapesLocation,versionName:versionName,grapesOrHtml:'grapes']"/> 718 <set field="updatedEmailTemplateList" from="updatedEmailTemplateList + [emailTemplate:emailTemplate,location:emailTemplate.grapesLocation,versionName:versionName,grapesOrHtml:'grapes']"/>
714 <set field="updatedEmailTemplate" from="true"/> 719 <set field="updatedEmailTemplate" from="true"/>
715 <set field="logText" from="logText + ' updating grapesPublishedVersionName to ' + versionName"/> 720 <set field="logText" from="logText + ' updating grapesPublishedVersionName to ' + versionName"/>
716 </if> 721 </if>
717 <if condition="emailTemplate.htmlLocation == dbResourceToUpdate.location"> 722 <if condition="emailTemplate.htmlLocation == dbResourceToUpdate.location &amp;&amp; emailTemplate.htmlPublishedVersionName != versionName">
718 <set field="emailTemplate.htmlPublishedVersionName" from="versionName"/> 723 <set field="emailTemplate.htmlPublishedVersionName" from="versionName"/>
719 <set field="updatedEmailTemplateList" from="updatedEmailTemplateList + [emailTemplate:emailTemplate,location:emailTemplate.htmlLocation,versionName:versionName,grapesOrHtml:'html']"/> 724 <set field="updatedEmailTemplateList" from="updatedEmailTemplateList + [emailTemplate:emailTemplate,location:emailTemplate.htmlLocation,versionName:versionName,grapesOrHtml:'html']"/>
720 <set field="updatedEmailTemplate" from="true"/> 725 <set field="updatedEmailTemplate" from="true"/>
721 <set field="logText" from="logText + ' updating htmlPublishedVersionName to ' + versionName"/> 726 <set field="logText" from="logText + ' updating htmlPublishedVersionName to ' + versionName"/>
722 </if> 727 </if>
723 <log level="info" message="${logText}"/>
724 <entity-update value-field="emailTemplate"/> 728 <entity-update value-field="emailTemplate"/>
725 </iterate> 729 </iterate>
726 </if> 730 </if>
727 </then><else>
728 <log level="info" message="Not updating from disk because file at ${child.location} and dbresource at ${dbResourceToUpdate.location} are the same"/>
729 </else></if>
730
731 </iterate> 731 </iterate>
732 </actions> 732 </actions>
733 </service> 733 </service>
......