Author: lektran
Date: Tue Jul 10 02:07:16 2007
New Revision: 554875
URL:
http://svn.apache.org/viewvc?view=rev&rev=554875Log:
Applied fix from trunk for revision: 551689
Modified:
ofbiz/branches/release4.0/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java
Modified: ofbiz/branches/release4.0/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java?view=diff&rev=554875&r1=554874&r2=554875==============================================================================
--- ofbiz/branches/release4.0/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java (original)
+++ ofbiz/branches/release4.0/applications/marketing/src/org/ofbiz/marketing/tracking/TrackingCodeEvents.java Tue Jul 10 02:07:16 2007
@@ -375,7 +375,7 @@
List trackingCodeOrders = new LinkedList();
Cookie[] cookies = request.getCookies();
- String affiliateReferredTimeStamp = null;
+ Timestamp affiliateReferredTimeStamp = null;
String siteId = null;
String isBillable = null;
String trackingCodeId = null;
@@ -392,7 +392,14 @@
// find the referred timestamp cookie if it exists
if ("Ofbiz.TKCD.UpdatedTimeStamp".equals(cookieName)) {
- affiliateReferredTimeStamp = cookies[i].getValue();
+ String affiliateReferredTime = cookies[i].getValue();
+ if (affiliateReferredTime !=null && !affiliateReferredTime.equals("")){
+ try{
+ affiliateReferredTimeStamp = Timestamp.valueOf(affiliateReferredTime);
+ }catch (IllegalArgumentException e){
+ Debug.logError(e, "Error parsing affiliateReferredTimeStamp value from cookie", module);
+ }
+ }
}
// find any that start with TKCDB_ for billable tracking code cookies with isBillable=Y
@@ -426,7 +433,7 @@
GenericValue trackingCodeOrder = delegator.makeValue("TrackingCodeOrder",
UtilMisc.toMap("trackingCodeTypeId", trackingCode.get("trackingCodeTypeId"),
"trackingCodeId", trackingCodeId, "isBillable", isBillable, "siteId", siteId,
- "hasExported", "N", "affiliateReferredTimeStamp",Timestamp.valueOf(affiliateReferredTimeStamp) ));
+ "hasExported", "N", "affiliateReferredTimeStamp",affiliateReferredTimeStamp ));
Debug.logInfo(" trackingCodeOrder is " + trackingCodeOrder, module);
trackingCodeOrders.add(trackingCodeOrder);