[ 
https://issues.apache.org/jira/browse/OFBIZ-2928?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mridul Pathak updated OFBIZ-2928:
---------------------------------

    Attachment: OFBiz-2928.patch

Adrian,

    I tried your patch, but there are two problems with it:

1) Resolving localized variables through VariableMapper, and resolving property 
of LocalizedMap are conflicting, in the later case the property of 
GenericEntity isn't getting resolved as the code is trying to find locale in 
GenericEntity object even when locale is already resolved in 
ExtendedMapResolver.getValue() method.

2) The variable name modifier is not working for maps which are not instance of 
LocalizedMap.

In the attached patch, following the same approach as you did, I have tried to 
fix above two issues.  Please LMK how does it look.

> UEL doesn't support variable name modifiers for an object accessed via a key 
> in a Map
> -------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-2928
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2928
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 9.04, SVN trunk
>            Reporter: Mridul Pathak
>            Assignee: Adrian Crum
>             Fix For: Release Branch 9.04, SVN trunk
>
>         Attachments: OFBiz-2928.patch, OFBiz-2928.patch, OFBiz-2928.patch
>
>
> This was discussed a few months ago on dev mailing list. Variable name 
> modifier doesn't work for following code:
> {code:xml}
> <set field="itemIssuance.quantity" value="${parameters.quantity$double + 
> itemIssuance.quantity$double}" type="BigDecimal"/>
> {code}
> Gives following warning:
> 2009-06-18 22:02:59,475 (http-0.0.0.0-8443-1) [      
> GenericEntity.java:704:WARN ] The field name (or key) [quantity$double] is 
> not valid for entity [ItemIssuance], printing IllegalArgumentException 
> instead of throwing it because Map interface specification does not allow 
> throwing that exception.
> While it works for context variables like:
> {code:xml}
> <set field="itemIssuanceQuantity" from-field="itemIssuance.quantity" 
> type="BigDecimal"/>
> <set field="thisQuantity" from-field="parameters.quantity" type="BigDecimal"/>
> <set field="itemIssuance.quantity" value="${thisQuantity$double + 
> itemIssuanceQuantity$double}" type="BigDecimal"/>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to