You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Thomas Mortagne (Jira)" <ji...@apache.org> on 2019/12/04 10:36:00 UTC

[jira] [Commented] (VELOCITY-904) Add a flag for better backward compatibility with null macro arguments

    [ https://issues.apache.org/jira/browse/VELOCITY-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16987724#comment-16987724 ] 

Thomas Mortagne commented on VELOCITY-904:
------------------------------------------

Looks like there is still differences with 1.7 when the passed variable is not null.

{code}
#macro(testmacro $parameter)
  #set($parameter = $NULL)

  $parameter
#end

#set($return = 'value')
#testmacro($return)
{code}

1.7: $return
2.2RC1: $parameter

We have some code which expect the 1.7 behaviour so while it's easy to workaround (set it to null before calling testmacro) it's not very convenient and not easy to track down all places to fix for 2.2 plus we don't control all the scripts used with XWiki as a development platform anyway so it can be a big breakage for some users.

> Add a flag for better backward compatibility with null macro arguments
> ----------------------------------------------------------------------
>
>                 Key: VELOCITY-904
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-904
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: 2.0
>            Reporter: Claude Brisson
>            Assignee: Claude Brisson
>            Priority: Minor
>             Fix For: 2.1
>
>
> See [this comment|https://issues.apache.org/jira/browse/VELOCITY-542?focusedCommentId=16621819&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16621819] :
> {code}
> #macro(testmacro $parameter)
>   $parameter
> #end
> #testmacro($return)
> {code}
> bq. which used to print "$return" (when $return is null or undefined) and we now get "$parameter". 
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org