OFBiz
  1. OFBiz
  2. OFBIZ-904

Error when "Inventory Facility Id" is left blank in product store settings

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      OFBiz Rev. 529997 on Windows XP.

      Description

      When creating a new store and the "Inventory Facility Id" field is left blank (with the store settings) then the productlist (Browse categories in the e-commerce store) gives an error and is not rendered.

      Error:
      2007-04-19 10:13:16,515 (http-0.0.0.0-8080-Processor3) [ ModelScreen.java:148:ERROR] Error rendering screen component://ecommerce/widget/CatalogScreens.xml#productsummary: org.ofbiz.base.util.GeneralException: Error running BSH script at location [component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productsummary.bsh]: org.ofbiz.base.util.GeneralException: Error running BSH script at [component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productsummary.bsh], line [65]: Sourced file: component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productsummary.bsh internal Error: Null value in getAssignableForm. : at Line: 65 : in file: component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productsummary.bsh : if ( product != null ) {
      (Sourced file: component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productsummary.bsh internal Error: Null value in getAssignableForm.) (Error running BSH script at [component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productsummary.bsh], line [65]: Sourced file: component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productsummary.bsh internal Error: Null value in getAssignableForm. : at Line: 65 : in file: component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productsummary.bsh : if ( product != null ) {
      (Sourced file: component://order/webapp/ordermgr/WEB-INF/actions/entry/catalog/productsummary.bsh internal Error: Null value in getAssignableForm.)). Rolling back transaction.

      Think it has something todo with:
      file:/D:/ofbiz/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
      2007-04-19 10:12:27,843 (http-0.0.0.0-8080-Processor3) [ ServiceDispatcher.java:459:DEBUG] Sync service [ecommerce/getInventoryAvailableByFacility]

      So maybe the "Inventory Facility Id" field has to be a required field? Or maybe better to run the "getInventoryAvailableByFacility" only when an Inventory Facility is filled with the store settings?

      Comment Jacopo: this should be improved; for example the facility in the store should be mandatory if the requireInventory flag is set.

        Activity

        Hide
        Scott Gray added a comment -

        Oh and we could add some validation to create/updateProductStore to ensure that a facilityId is supplied if oneInventoryFacility == "Y"

        Show
        Scott Gray added a comment - Oh and we could add some validation to create/updateProductStore to ensure that a facilityId is supplied if oneInventoryFacility == "Y"
        Hide
        Scott Gray added a comment -

        No it shouldn't, it is quite possible for a ProductStore to be supplied from multiple facilities as specified by the ProductStoreFacility entity.

        The code appears to run that block in order to determine the daysToShip if inventory is available. In this case I think it would probably be better to call isStoreInventoryAvailable and if inventory is available then either get the daysToShip from the facility (if we have a facilityId) or get the lowest value from the facilities associated via ProductStoreFacility.

        Show
        Scott Gray added a comment - No it shouldn't, it is quite possible for a ProductStore to be supplied from multiple facilities as specified by the ProductStoreFacility entity. The code appears to run that block in order to determine the daysToShip if inventory is available. In this case I think it would probably be better to call isStoreInventoryAvailable and if inventory is available then either get the daysToShip from the facility (if we have a facilityId) or get the lowest value from the facilities associated via ProductStoreFacility.
        Hide
        Ankit Jain added a comment -

        Okay got the issue. Thanks Scott.

        So should "inventoryFacilityId" be mandatory at the time of ProductStore creation??

        Show
        Ankit Jain added a comment - Okay got the issue. Thanks Scott. So should "inventoryFacilityId" be mandatory at the time of ProductStore creation??
        Hide
        Pierre Smits added a comment -

        Given that we're maintaining the 10.04 codebase well into the year 2013 and the inventoryFacilityId is required in various applications, we should better update the affected versions on this topic.

        Show
        Pierre Smits added a comment - Given that we're maintaining the 10.04 codebase well into the year 2013 and the inventoryFacilityId is required in various applications, we should better update the affected versions on this topic.
        Hide
        Scott Gray added a comment -

        Just realized I was looking at the 10.04 codebase, the same still applies but at lines 52 and 69

        Show
        Scott Gray added a comment - Just realized I was looking at the 10.04 codebase, the same still applies but at lines 52 and 69
        Hide
        Scott Gray added a comment -

        Do not close this issue. facilityId is a required parameter for the getInventoryAvailableByFacility service and line 68 in ProductSummary.groovy will throw an exception if the productStore.inventoryFacilityId assignment on line 51 comes back null.

        Show
        Scott Gray added a comment - Do not close this issue. facilityId is a required parameter for the getInventoryAvailableByFacility service and line 68 in ProductSummary.groovy will throw an exception if the productStore.inventoryFacilityId assignment on line 51 comes back null.
        Hide
        Pierre Smits added a comment -

        This issue is 5 years old. Even from before the release of the O9 branch.

        I propose to close it.

        Show
        Pierre Smits added a comment - This issue is 5 years old. Even from before the release of the O9 branch. I propose to close it.
        Hide
        Ankit Jain added a comment -

        Its working fine for me, if its not please write steps to reproduce.

        Show
        Ankit Jain added a comment - Its working fine for me, if its not please write steps to reproduce.
        Hide
        Jacques Le Roux added a comment -

        Mmm reading fast, it seems to me that I just changed the type of the issue from improvement to bug, so no: should not be close until fixed

        Show
        Jacques Le Roux added a comment - Mmm reading fast, it seems to me that I just changed the type of the issue from improvement to bug, so no: should not be close until fixed
        Hide
        Erwan de FERRIERES added a comment -

        Jacques, Kiran

        can this issue can be closed ?

        Show
        Erwan de FERRIERES added a comment - Jacques, Kiran can this issue can be closed ?
        Hide
        Jacques Le Roux added a comment -

        Done as Kiran asked

        Show
        Jacques Le Roux added a comment - Done as Kiran asked
        Hide
        Kiran Gawde added a comment -

        inventoryFacility can be left blank if there are more than one facility per store. I don't see productsummary.bsh. But the similar error happens in \applications\order\webapp\ordermgr\WEB-INF\actions\entry\catalog\ProductSummary.groovy. This is not an improvement, it is an defect. Can we please change the type on this issue and increase the priority? Thanks.

        Show
        Kiran Gawde added a comment - inventoryFacility can be left blank if there are more than one facility per store. I don't see productsummary.bsh. But the similar error happens in \applications\order\webapp\ordermgr\WEB-INF\actions\entry\catalog\ProductSummary.groovy. This is not an improvement, it is an defect. Can we please change the type on this issue and increase the priority? Thanks.

          People

          • Assignee:
            Unassigned
            Reporter:
            Michel Dielissen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development