You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2018/12/31 09:09:33 UTC

svn commit: r1850023 - /ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java

Author: jleroux
Date: Mon Dec 31 09:09:33 2018
New Revision: 1850023

URL: http://svn.apache.org/viewvc?rev=1850023&view=rev
Log:
Improved: Product Promo Worker description patch
(OFBIZ-3907)

Completes initial work from Sascha Rodekamp

Returns promoName then promoText if promoName absent then and 
"No promotion name nor text" if either are present.

We lose the information in promoText but at least it's correctly rendered in 
invoices PDF and accounting component.

Thanks: Scott for report

Modified:
    ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java

Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java?rev=1850023&r1=1850022&r2=1850023&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/product/ProductPromoWorker.java Mon Dec 31 09:09:33 2018
@@ -1249,10 +1249,13 @@ public final class ProductPromoWorker {
         GenericValue prodPromo;
         try {
             prodPromo = EntityQuery.use(delegator).from("ProductPromo").where("productPromoId", prodPromoId).cache().queryOne();
+            if (UtilValidate.isNotEmpty(prodPromo.get("promoName"))) {
+                return (String) prodPromo.get("promoName");
+            }
             if (UtilValidate.isNotEmpty(prodPromo.get("promoText"))) {
                 return (String) prodPromo.get("promoText");
             }
-            return (String) prodPromo.get("promoName");
+            return "No promotion name nor text";
 
         } catch (GenericEntityException e) {
             Debug.logWarning("Error getting ProductPromo for Id " + prodPromoId, module);