You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Jacques Le Roux (JIRA)" <ji...@apache.org> on 2015/04/13 08:23:12 UTC

[jira] [Updated] (OFBIZ-6249) Complete OFBIZ-6057 (error in Freemarker 2.3 versions higher than 2.3.19)

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

Jacques Le Roux updated OFBIZ-6249:
-----------------------------------
    Summary: Complete OFBIZ-6057 (error in Freemarker 2.3 versions higher than 2.3.19)  (was: Complete OFBIZ-6057)

> Complete OFBIZ-6057 (error in Freemarker 2.3 versions higher than 2.3.19)
> -------------------------------------------------------------------------
>
>                 Key: OFBIZ-6249
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6249
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting, order
>    Affects Versions: Release Branch 13.07, Release Branch 14.12, Trunk
>            Reporter: Jacques Le Roux
>            Assignee: Jacques Le Roux
>
> This is the contiunation of OFBIZ-6057 which have fixed the case below, I simply sort of quote its description here to get the idea:
> {quote}
> In order to fix OFBIZ-2120, code was added to the applications/order/webapp/ordermgr/quote/ViewQuoteItemInfo.ftl file. This was  working with previous versions of Freemarker but is now in 2.3 a problem at line 46 of this commit: https://github.com/apache/ofbiz/commit/27253c4667e87721212fa8955d75c74a0d171c73
> This ends up causing the following error:
> {quote}
> {code}
>      [java] freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
>      [java] ==> null  [in template "component://order/webapp/ordermgr/quote/ViewQuoteItemInfo.ftl" at line 56, column 40]
>      [java] Tip: If the failing expression is known to be legally refer to something that's null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
>      [java] FTL stack trace ("~" means nesting-related):
>      [java] 	- Failed at: #assign product = null  [in template "component://order/webapp/ordermgr/quote/ViewQuoteItemInfo.ftl" at line 56, column 21]
>      [java] 	- Reached through: #list quoteItems as quoteItem  [in template "component://order/webapp/ordermgr/quote/ViewQuoteItemInfo.ftl" at line 52, column 13]
> {code}
> {quote}
> The main reason for this is because there is no concept of "null" in FreeMarker 2.3 (after 2.3.19), as the following thread kinda explains: http://ehc.ac/p/freemarker/discussion/2346/thread/85da30a4/  Not sure how to go about fixing this error, the thread suggests setting the variable to the string "null".
> {quote}
> There are still other instances of this bug in:
> {code}
> applications/order/webapp/ordermgr/return/returnItems.ftl 
>     <#assign returnItemSubTotal = null > <#-- otherwise the last item's might carry over -->
> applications/accounting/webapp/accounting/reports/DepositSlip.fo.ftl 
>     <#assign creditCard = null/>
> framework/webtools/webapp/webtools/datafile/viewdatafile.ftl 
>     <#assign lastRecordName = null>
> {code}
> There is no needs to change R12.04 though it uses Freemarker 2.3, exactly 2.3.19. I guess this issue only exists in 2.3 versions above 2.3.19!
> Note that this should no longer be a problem in Freemarker 2.4... and hopefully above... But for now the other null assignments are wrong in trunk and newer branches.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)