This is an automated email from the ASF dual-hosted git repository.
mridulpathak pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/release24.09 by this push:
new 3d639a6d72 Fixed: Two regressions in the minilang-to-Groovy conversion
of CommonServicesScript.groovy (OFBIZ-13610)
3d639a6d72 is described below
commit 3d639a6d724ffaba72c3ded77fe18ef575e3d152
Author: Mridul Pathak <[email protected]>
AuthorDate: Sat Sep 26 16:37:15 2026 +0530
Fixed: Two regressions in the minilang-to-Groovy conversion of
CommonServicesScript.groovy (OFBIZ-13610)
convertUom() no longer skips the configured decimal-scale rounding step
when the converted value is legitimately zero, since Groovy treats a zero
BigDecimal as falsy and the previous truthiness check masked that case;
switched to an explicit null check, matching the original mini-lang which gated
this step only on roundingMode being present.
getFileUploadProgressStatus() now truncates readPercent to an int as the
original mini-lang did, instead of returning a full-precision BigDecimal from
Groovy's division, matching the servicedef's declared Integer OUT type.
---
.../main/groovy/org/apache/ofbiz/common/CommonServicesScript.groovy | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
a/framework/common/src/main/groovy/org/apache/ofbiz/common/CommonServicesScript.groovy
b/framework/common/src/main/groovy/org/apache/ofbiz/common/CommonServicesScript.groovy
index 3ca91c175d..e9f91954c9 100644
---
a/framework/common/src/main/groovy/org/apache/ofbiz/common/CommonServicesScript.groovy
+++
b/framework/common/src/main/groovy/org/apache/ofbiz/common/CommonServicesScript.groovy
@@ -124,7 +124,7 @@ Map convertUom() {
// round result, if UomConversion[Dated] so specifies
decimalScale = uomConversion.decimalScale ?: parameters.defaultDecimalScale
roundingMode = uomConversion.roundingMode ?: parameters.defaultRoundingMode
- if (convertedValue && roundingMode) {
+ if (convertedValue != null && roundingMode) {
if (roundingMode instanceof String) {
String modeStr = roundingMode.replace('ROUND_',
'').replaceAll('([a-z])([A-Z])', '$1_$2').toUpperCase()
try {
@@ -175,7 +175,7 @@ Map getFileUploadProgressStatus() {
result.bytesRead = uploadProgressListener.getBytesRead()
result.hasStarted = uploadProgressListener.hasStarted()
- result.readPercent = (result.bytesRead * 100) / result.contentLength
+ result.readPercent = (int) ((result.bytesRead * 100) /
result.contentLength)
}
return result
}