Author: mor
Date: Wed Jun 25 08:02:51 2014
New Revision: 1605286

URL: http://svn.apache.org/r1605286
Log:
Fix: When redirectAddress is specified and mail notification is disabled 
'subject' can grow longer than the specified char limit in db and the service 
updateCommEventAfterEmail triggered on sendMail is failing for the same reason. 
The issue occurred when system invoke a failed job for the service 
sendCommEventAsEmail.
Note: sendCommEventAsEmail service also update the status of communication 
event by calling an inline service setCommEventComplete if there is no error in 
sendMail result. The service updateCommEventAfterEmail is also triggered by an 
eca on sendEmail which also do the same. They both eventually callthe service 
updateCommunicationEvent. In this case we should option (1) not call 
updateCommEventAfterEmail or option (2) make changes to 
updateCommunicationEvent so that it check for a status valid change before 
updating the communciation event record or option(3) just make 
updateCommEventAfterEmail responsible for updating the communication event 
record by removing the inline code that update the communication event to 
complete. Option (2) seemsright to me. 

Modified:
    ofbiz/trunk/framework/common/src/org/ofbiz/common/email/EmailServices.java

Modified: 
ofbiz/trunk/framework/common/src/org/ofbiz/common/email/EmailServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/email/EmailServices.java?rev=1605286&r1=1605285&r2=1605286&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/email/EmailServices.java 
(original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/email/EmailServices.java 
Wed Jun 25 08:02:51 2014
@@ -143,6 +143,9 @@ public class EmailServices {
             sendTo = redirectAddress;
             sendCc = null;
             sendBcc = null;
+            if (subject.length() > 255) {
+                subject = subject.substring(0, 255);
+            }
         }
 
         String sendFrom = (String) context.get("sendFrom");


Reply via email to