|
[ https://issues.apache.org/jira/browse/OFBIZ-11465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17063884#comment-17063884 ] Pawan Verma commented on OFBIZ-11465: ------------------------------------- [~pierresmits] IMHO, A existing bug can not be handled in the improvement PR, it should have a separate PR or patch. {panel:title=If you had taken it without the slight adjustments I quess that would not have led to the merge conflict.} I have modified code as it was required, fetching data from Type entity should use a cache, it's a good practice. {panel} {panel:title=A revert of the commit should fix the PR again} The code I committed is right in my sense and rectifies the problem reported in this JIRA. IMHO, it's right and I prefer to correct a PR instead of revert a good fix. {panel} Thanks for your cooperation with this. > 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: Pawan Verma > Priority: Major > Labels: ProductDimension, birt, dimension, dwh, product, service > Fix For: Upcoming Branch > > > 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: > {code:xml} > <simple-method method-name="prepareProductDimensionData" short-description=""> > <entity-one entity-name="Product" value-field="product"/> > <if-empty field="product"> > <add-error> > <fail-property resource="ProductUiLabels" property="ProductProductNotFoundWithProduct"/> > </add-error> > </if-empty> > <check-errors/> > <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"/> > </simple-method> > {code} > This was replace with groovy code: > {code:java} > def prepareProductDimensionData() { > GenericValue product = from("Product").where("productId", parameters.productId).queryOne() > if (product == null) { > return error(UtilProperties.getMessage('ProductUiLabels', 'ProductProductNotFoundWithProduct', locale)) > } > productDimension = delegator.makeValue("ProductDimension") > productDimension.setNonPKFields(parameters) > GenericValue productType = select("description").from("Product").where("productId", parameters.productId).queryOne() > productDimension.productType = productType.description > Map result = success() > result.productDimension = productDimension > return result > } > {code} > 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 (v8.3.4#803005) |
| Free forum by Nabble | Edit this page |
