[jira] [Updated] (OFBIZ-4902) Replace in Freemarker templates the deprecated built-ins: default, exists, if_exists

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (OFBIZ-4902) Replace in Freemarker templates the deprecated built-ins: default, exists, if_exists

Nicolas Malin (Jira)

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

Deepak Dixit updated OFBIZ-4902:
--------------------------------

    Attachment: OFBIZ-4902.patch

Here is the updated patch with fix of wrong uses of if_exists.

As per current implementation some places use if_exists wrongly like in orderinfo.ftl

{code}
${orderType?if_exists.get("description", locale)
{code}

Its incorrect as if orderType is not exists then it will throw the stack trace.

As we replace ?if_exists with ! then this code will throw the stack trace "Unknown built-in variable: get in <file location>"

In this patch we used the following pattern for this kind of code:
{code}
${(orderType!).get("description", locale)
{code}

Will create new task to fix this kind of code.
               

> Replace in Freemarker templates the deprecated built-ins: default, exists, if_exists
> ------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-4902
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4902
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: ALL COMPONENTS
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>            Assignee: Ashish Vijaywargiya
>            Priority: Minor
>         Attachments: OFBIZ-4902.patch, OFBIZ-4902.patch
>
>
> http://freemarker.org/docs/ref_depr_builtin.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira