You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Nicolas Malin (Jira)" <ji...@apache.org> on 2022/06/17 08:37:00 UTC
[jira] [Closed] (OFBIZ-12649) Function ProductWorker.shippingApplies failed if chargeShipping is empty
[ https://issues.apache.org/jira/browse/OFBIZ-12649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nicolas Malin closed OFBIZ-12649.
---------------------------------
Fix Version/s: 22.01.01
Resolution: Fixed
> Function ProductWorker.shippingApplies failed if chargeShipping is empty
> ------------------------------------------------------------------------
>
> Key: OFBIZ-12649
> URL: https://issues.apache.org/jira/browse/OFBIZ-12649
> Project: OFBiz
> Issue Type: Bug
> Components: product
> Affects Versions: 22.01.01
> Reporter: Nicolas Malin
> Assignee: Nicolas Malin
> Priority: Trivial
> Fix For: 22.01.01
>
>
> 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
>
> {code:java}
> Boolean chargeShipping = product.getBoolean("chargeShipping");
> if (chargeShipping == null) {
> return true;
> }
> return chargeShipping;
> {code}
> 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
>
> {code:java}
> public Boolean getBoolean(String name) {
> Object obj = get(name);
> if (obj == null) {
> return false;
> }
> {code}
> So in this case the function ProductWorker.shippingApplies return always false instead true.
>
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)