Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-12649

Function ProductWorker.shippingApplies failed if chargeShipping is empty

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 22.01.01
    • 22.01.01
    • product
    • None

    Description

      When you compute the estimated shipping cost, you compute the quantity of product to ship.

      This use the ProductWorker.shippingApplies for each product to know if it need to be ship or not.

      On this function the code

       

      Boolean chargeShipping = product.getBoolean("chargeShipping");
      if (chargeShipping == null) {
          return true;
      }
      return chargeShipping;
      

      is wrong if the field chargeShipping is empty on a product.

      The reason is simple, GenericValue.getBoolean return false if the field is empty

      GenericEntity.java:738

       

          public Boolean getBoolean(String name) {
              Object obj = get(name);
              if (obj == null) {
                  return false;
              }
      

      So in this case the function ProductWorker.shippingApplies return always false instead true.

       

       

      Attachments

        Issue Links

          Activity

            People

              nmalin Nicolas Malin
              nmalin Nicolas Malin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: