You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Mridul Pathak (Jira)" <ji...@apache.org> on 2026/09/11 11:34:00 UTC

[jira] [Created] (OFBIZ-13570) Fix Mini-lang to Groovy regressions in CommonServicesScript.groovy

Mridul Pathak created OFBIZ-13570:
-------------------------------------

             Summary: Fix Mini-lang to Groovy regressions in CommonServicesScript.groovy
                 Key: OFBIZ-13570
                 URL: https://issues.apache.org/jira/browse/OFBIZ-13570
             Project: OFBiz
          Issue Type: Bug
          Components: framework/common
    Affects Versions: 24.09.07, Upcoming Branch
            Reporter: Mridul Pathak
            Assignee: Mridul Pathak


During the conversion of CommonServices.xml from Mini-lang to Groovy (OFBIZ-11402), several logic regressions and typos were introduced in CommonServicesScript.groovy:

1. checkUomConversionDated:
   - Queries from('UomConversion') instead of from('UomConversionDated'), which fails when filtering by date or purposeEnumId as those fields only exist on UomConversionDated.
   - Checks queryCount() == 1 instead of > 0, failing when multiple active conversions exist for a given UOM pair.

2. checkUomConversion:
   - Checks queryCount() == 1 instead of > 0.

3. getVisualThemeResources:
   - Contains a typo in the map key: resouceTypeEnumId instead of resourceTypeEnumId.
   - Violates the service contract (which defines themeResources as a Map of Lists, where each resourceTypeEnumId maps to a List of resourceValue Strings): Groovy assigns a single Map, causing subsequent resources of the same type to overwrite previous ones rather than accumulating into a List.

4. convertUom:
   - Calls logVerbose("using conversion factor=${uomConversion.conversionFactor}") before checking if (!uomConversion), causing a NullPointerException if no conversion is found when verbose logging is enabled.
   - Queries UomConversion using where(parameters) with extraneous non-entity parameters instead of scoping to uomId and uomIdTo.

5. linkGeos:
   - Iterates parameters.geoIds using a Java-style for loop without a null check, causing a NullPointerException if the optional geoIds parameter is omitted or null.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)