You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Ravi Lodhi (JIRA)" <ji...@apache.org> on 2015/04/18 13:15:58 UTC

[jira] [Commented] (OFBIZ-4728) productdetail.ftl shows only primaryProductCategoryId even though a productCategoryId is handed over

    [ https://issues.apache.org/jira/browse/OFBIZ-4728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14501273#comment-14501273 ] 

Ravi Lodhi commented on OFBIZ-4728:
-----------------------------------

I tried following steps to regenerate this issue - 
1. Created a product without primaryProductCategoryId and associated with a category by creating ProductCategoryMember record.
2. Then visited category details/product summary and product detail page and got no error, niether on the screen nor on the console.

I am not able to regenerate NullPointerException in the CatalogScreens.xml.
It might be possible that this should be fixed while widget overhauling.


> productdetail.ftl shows only primaryProductCategoryId even though a productCategoryId is handed over
> ----------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4728
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4728
>             Project: OFBiz
>          Issue Type: Bug
>          Components: specialpurpose/ecommerce
>    Affects Versions: Trunk
>            Reporter: Markus M. May
>            Priority: Minor
>
> 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?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)