ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pierre Smits (Jira)" <j...@apache.org>
Subject [jira] [Created] (OFBIZ-11465) prepareProductDimensionData does not load correct fields in ProductDimension
Date Wed, 18 Mar 2020 09:33:00 GMT
Pierre Smits created OFBIZ-11465:

             Summary: prepareProductDimensionData does not load correct fields in ProductDimension
                 Key: OFBIZ-11465
                 URL: https://issues.apache.org/jira/browse/OFBIZ-11465
             Project: OFBiz
          Issue Type: Sub-task
          Components: bi
    Affects Versions: Trunk
            Reporter: Pierre Smits
            Assignee: Pierre Smits

With the implementation of the patch ofOFBIZ-10948 an error was introduced that led to fields
in the ProductDimension to be populated in a wrong way.

The replaced minilang code encompassed:
<simple-method method-name="prepareProductDimensionData" short-description="">
         <entity-one entity-name="Product" value-field="product"/>
         <if-empty field="product">
                 <fail-property resource="ProductUiLabels" property="ProductProductNotFoundWithProduct"/>
         <make-value entity-name="ProductDimension" value-field="productDimension"/>
         <set-nonpk-fields map="product" value-field="productDimension"/>

         <get-related-one value-field="product" relation-name="ProductType" to-value-field="productType"/>
         <set field="productDimension.productType" from-field="productType.description"/>

         <field-to-result field="productDimension"/>

This was replace with groovy code:
def prepareProductDimensionData() {
     GenericValue product = from("Product").where("productId", parameters.productId).queryOne()
     if (product == null) {
         return error(UtilProperties.getMessage('ProductUiLabels', 'ProductProductNotFoundWithProduct',
     productDimension = delegator.makeValue("ProductDimension")
     GenericValue productType = select("description").from("Product").where("productId", parameters.productId).queryOne()
     productDimension.productType = productType.description
     Map result = success()
     result.productDimension = productDimension
     return result

2 things happened: 
* the key-value pairs of the product were not injected into the projectDimension object, but
rather only parameters (not including these parse);
* the description of the productType associated with the product was not injected into the
productDimension object, but rather the description of the product.

This message was sent by Atlassian Jira

View raw message