Improved: Remove hardcoded product category on CategoryWorker.getCatalogTopCategory
When you call the java function
org.apache.ofbiz.product.category.CategoryWorker.getCatalogTopCategory()
the catalog returned if the system failed found it is hardcoded and don't use an
existing property : catalog->top.category.default
Thanks: Nicolas
@@ -42,6 +42,7 @@ import org.apache.ofbiz.entity.GenericValue;
import org.apache.ofbiz.entity.condition.EntityCondition;
import org.apache.ofbiz.entity.util.EntityQuery;
import org.apache.ofbiz.entity.util.EntityUtil;
+import org.apache.ofbiz.entity.util.EntityUtilProperties;
import org.apache.ofbiz.product.product.ProductWorker;
import org.apache.ofbiz.service.DispatchContext;
import org.apache.ofbiz.service.ServiceUtil;
@@ -75,7 +76,8 @@ public final class CategoryWorker {
topCatName = defaultTopCategory;
}
if (topCatName == null) {
- topCatName = "CATALOG1";
+ topCatName = EntityUtilProperties.getPropertyValue("catalog", "top.category.default", "CATALOG1",
+ (Delegator) request.getAttribute("delegator"));
}
if (!fromSession) {
