Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Cannot Reproduce
-
Trunk
-
None
-
None
-
Bug Crush Event - 21/2/2015
Description
On the productsummary.ftl the productUrl is constructed like:
<#assign productUrl><@ofbizCatalogAltUrl productId=product.productId productCategoryId=categoryId/></#assign>
This works fine, unfortunately in the ProductDetail.groovy the following assignment returns null if the primaryProductCategoryId is not set on the product:
// get next/previous information for category
categoryId = parameters.category_id ?: product.primaryProductCategoryId;
This leads to a nasty NullPointerException in the CatalogScreens.xml.
I would propose the following solution in the applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy:
// get next/previous information for category
categoryId = parameters.productCategoryId ?: parameters.category_id ?: product.primaryProductCategoryId;
I am unsure, why the parameter is named productCategoryId after the call of the ofbizCatalogAltUrl, whereas it is named category throughout the rest of the application. Another fix could be to rename this parameter in the ofbizCatalogAltUrl.
What do you think?