You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jo...@apache.org on 2007/02/19 10:52:47 UTC

svn commit: r509142 - /ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java

Author: jonesde
Date: Mon Feb 19 01:52:47 2007
New Revision: 509142

URL: http://svn.apache.org/viewvc?view=rev&rev=509142
Log:
Fixed problem with categories that only have a name, and changed it to use the CategoryContentWrapper instead of getting the fields directly from the entity

Modified:
    ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java?view=diff&rev=509142&r1=509141&r2=509142
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/ProductSearch.java Mon Feb 19 01:52:47 2007
@@ -55,6 +55,7 @@
 import org.ofbiz.entity.util.EntityListIterator;
 import org.ofbiz.entity.util.EntityUtil;
 import org.ofbiz.party.party.PartyHelper;
+import org.ofbiz.product.category.CategoryContentWrapper;
 
 
 /**
@@ -631,7 +632,11 @@
             StringBuffer ppBuf = new StringBuffer();            
             ppBuf.append(UtilProperties.getMessage(resource, "ProductCategory", locale)+": ");
             if (productCategory != null) {
-                ppBuf.append(productCategory.getString("description"));
+                String catInfo = CategoryContentWrapper.getProductCategoryContentAsText(productCategory, "CATEGORY_NAME", locale);
+                if (UtilValidate.isEmpty(catInfo)) {
+                    catInfo = CategoryContentWrapper.getProductCategoryContentAsText(productCategory, "DESCRIPTION", locale);
+                }
+                ppBuf.append(catInfo);
             }
             if (productCategory == null || detailed) {
                 ppBuf.append(" [");