Author: jonesde
Date: Mon Feb 19 01:52:47 2007
New Revision: 509142
URL:
http://svn.apache.org/viewvc?view=rev&rev=509142Log:
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(" [");