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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)
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: SVN 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

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

Nicolas Malin (Jira)

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

Jacques Le Roux commented on OFBIZ-4728:
----------------------------------------

Hi Markus,

productCategoryId is the entity field name, if you see no side effects to rename productCategoryId to category in ofbizCatalogAltUrl then I see no reasons to not rename it. Please check all other occurences, I found at least categorydetail.ftl (commented out), ajaxbreadcrumbs.ftl, minilastviewedcategories.ftl, miniproductsummary.ftl, productdetail.ftl, ShowBestSellingCategory.ftl, sidedeepcategory.ftl and tellafriend.ftl
               

> 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: SVN 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira