Author: mbrohl
Date: Tue Mar 13 19:47:09 2018
New Revision: 1826675

URL: http://svn.apache.org/viewvc?rev=1826675&view=rev
Log:
Applied fix from trunk for revision: 1826674 
===

Fixed: EmailServices.sendMailFromScreen attachment rendering broken.
(OFBIZ-10246)

Thanks Martin for reporting and providing the patch.

Modified:
    ofbiz/ofbiz-framework/branches/release17.12/   (props changed)
    
ofbiz/ofbiz-framework/branches/release17.12/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java
    
ofbiz/ofbiz-framework/branches/release17.12/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java

Propchange: ofbiz/ofbiz-framework/branches/release17.12/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 13 19:47:09 2018
@@ -10,4 +10,4 @@
 /ofbiz/branches/json-integration-refactoring:1634077-1635900
 /ofbiz/branches/multitenant20100310:921280-927264
 /ofbiz/branches/release13.07:1547657
-/ofbiz/ofbiz-framework/trunk:1819499,1819598,1819800,1819805,1819811,1820038,1820262,1820374-1820375,1820441,1820457,1820644,1820658,1820790,1820823,1820949,1820966,1821012,1821036,1821112,1821115,1821144,1821186,1821219,1821226,1821230,1821386,1821600,1821613,1821628,1821965,1822125,1822310,1822377,1822383,1822393,1822882,1823324,1823467,1823562,1823876,1824260,1824314,1824316,1824732,1824803,1824847,1824855,1825192,1825211,1825216,1825233,1825450,1826374,1826502,1826592,1826671
+/ofbiz/ofbiz-framework/trunk:1819499,1819598,1819800,1819805,1819811,1820038,1820262,1820374-1820375,1820441,1820457,1820644,1820658,1820790,1820823,1820949,1820966,1821012,1821036,1821112,1821115,1821144,1821186,1821219,1821226,1821230,1821386,1821600,1821613,1821628,1821965,1822125,1822310,1822377,1822383,1822393,1822882,1823324,1823467,1823562,1823876,1824260,1824314,1824316,1824732,1824803,1824847,1824855,1825192,1825211,1825216,1825233,1825450,1826374,1826502,1826592,1826671,1826674

Modified: 
ofbiz/ofbiz-framework/branches/release17.12/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release17.12/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java?rev=1826675&r1=1826674&r2=1826675&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/branches/release17.12/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java
 (original)
+++ 
ofbiz/ofbiz-framework/branches/release17.12/framework/common/src/main/java/org/apache/ofbiz/common/email/EmailServices.java
 Tue Mar 13 19:47:09 2018
@@ -489,7 +489,7 @@ public class EmailServices {
 
         ScreenStringRenderer screenStringRenderer = null;
         try {
-            screenStringRenderer = new MacroScreenRenderer("screen", 
visualTheme.getModelTheme().getScreenRendererLocation("screen"));
+            screenStringRenderer = new 
MacroScreenRenderer(visualTheme.getModelTheme(), "screen");
         } catch (TemplateException | IOException e) {
             Debug.logError(e, "Error rendering screen for email: " + 
e.toString(), module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"CommonEmailSendRenderingScreenEmailError", UtilMisc.toMap("errorString", 
e.toString()), locale));
@@ -538,9 +538,9 @@ public class EmailServices {
                     // substitute the freemarker variables...
                     ScreenStringRenderer foScreenStringRenderer = null;
                     if(MimeConstants.MIME_PLAIN_TEXT.equals(attachmentType)){
-                        foScreenStringRenderer = new 
MacroScreenRenderer("screentext", 
visualTheme.getModelTheme().getScreenRendererLocation("screentext"));
+                        foScreenStringRenderer = new 
MacroScreenRenderer(visualTheme.getModelTheme(), "screentext");
                     }else{
-                        foScreenStringRenderer = new 
MacroScreenRenderer("screenfop", 
visualTheme.getModelTheme().getScreenRendererLocation("screenfop"));
+                        foScreenStringRenderer = new 
MacroScreenRenderer(visualTheme.getModelTheme(), "screenfop");
                     } 
                     ScreenRenderer screensAtt = new ScreenRenderer(writer, 
screenContext, foScreenStringRenderer);
                     screensAtt.populateContextForService(dctx, bodyParameters);

Modified: 
ofbiz/ofbiz-framework/branches/release17.12/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release17.12/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java?rev=1826675&r1=1826674&r2=1826675&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/branches/release17.12/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java
 (original)
+++ 
ofbiz/ofbiz-framework/branches/release17.12/framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java
 Tue Mar 13 19:47:09 2018
@@ -80,6 +80,10 @@ public class MacroScreenRenderer impleme
     protected boolean widgetCommentsEnabled = false;
     private int screenLetsIdCounter = 1;
 
+    public MacroScreenRenderer(ModelTheme theme, String modelTemplateName) 
throws TemplateException, IOException {
+        this(theme.getType(modelTemplateName), 
theme.getScreenRendererLocation(modelTemplateName));
+    }
+
     public MacroScreenRenderer(String name, String macroLibraryPath) throws 
TemplateException, IOException {
         macroLibrary = FreeMarkerWorker.getTemplate(macroLibraryPath);
         rendererName = name;


Reply via email to