svn commit: r892047 - /ofbiz/branches/release09.04/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r892047 - /ofbiz/branches/release09.04/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy

lektran
Author: lektran
Date: Fri Dec 18 00:54:28 2009
New Revision: 892047

URL: http://svn.apache.org/viewvc?rev=892047&view=rev
Log:
Partial merge from trunk r772850 (note commit message entirely unrelated):
since NEWSLETTER type marketing emails do not create unique communication events, added fields to keep track of party/message ID for these messages
Plus merge from trunk of r892037
Removed unnecessary use of UtilValidate.isNotEmpty, Groovy Truth handles this natively and returns true only for lists that are both not null AND not empty

Based on a bug report from Heidi Dehaes and modified patch from Adrian Cumiskey, OFBIZ-3362

Modified:
    ofbiz/branches/release09.04/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy

Modified: ofbiz/branches/release09.04/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy?rev=892047&r1=892046&r2=892047&view=diff
==============================================================================
--- ofbiz/branches/release09.04/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy (original)
+++ ofbiz/branches/release09.04/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy Fri Dec 18 00:54:28 2009
@@ -25,10 +25,13 @@
     ownerParty = contactList.getRelatedOne("OwnerParty");
     if (ownerParty) {
         contactMechs = ownerParty.getRelatedByAnd("PartyContactMechPurpose", [contactMechPurposeTypeId : "MARKETING_EMAIL"]);
-        if (!contactMechs || contactMechs.size() == 0) {
+        if (!contactMechs) {
             contactMechs = ownerParty.getRelatedByAnd("PartyContactMechPurpose", [contactMechPurposeTypeId : "PRIMARY_EMAIL"]);
         }
-        context.marketingEmail = contactMechs.get(0);
-        //context.contactMechIdFrom = context.marketingEmail.contactMechId;
+        
+        if (contactMechs) {
+            context.marketingEmail = contactMechs.get(0);
+            //context.contactMechIdFrom = context.marketingEmail.contactMechId;
+        }
     }
 }