[
https://issues.apache.org/jira/browse/VELOCITY-542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16621819#comment-16621819
]
Thomas Mortagne commented on VELOCITY-542:
------------------------------------------
bq. But it doesn't stop us from allowing a backward compatibility option
An option is perfectly fine for me (would not be the first anyway).
bq. What were those other changes?
On my side the main other change for which I would love to get retro compatible
options is the change in the way to handle macro parameters which change the
following behavior:
{code}
#macro(testmacro $parameter)
$parameter
#end
#testmacro($return)
{code}
which used to print "$return" (when $return is null or undefined) and we now
get "$parameter". Unfortunately I found quite a few scripts in the context of
XWiki which count on the old behavior for various reasons (main one being to
have a macro "return" a value by changing the value of the passed variable but
it's not possible to know that variable name anymore). It's definitely a hack
but one which is unfortunately used a lot when you need a macro to return
something else than a String.
There is also the following which feel more like bugs than the intended
behaviors:
* https://issues.apache.org/jira/browse/VELOCITY-896
* https://issues.apache.org/jira/browse/VELOCITY-897
> minus sign in #set requires spaces to surround it
> -------------------------------------------------
>
> Key: VELOCITY-542
> URL: https://issues.apache.org/jira/browse/VELOCITY-542
> Project: Velocity
> Issue Type: Bug
> Components: Engine
> Affects Versions: 1.5
> Reporter: Will Glass-Husain
> Assignee: Claude Brisson
> Priority: Minor
> Fix For: 2.0
>
>
> The following example:
> #set($thisCampNumber = 10)
> #set($nextCampNumber = $thisCampNumber+1)
> #set($previousCampNumber = $thisCampNumber-1)
> #set($previousCampNumberB = $thisCampNumber - 1)
> 1: $thisCampNumber<br>
> 2: $nextCampNumber<br>
> 3: $previousCampNumber<br>
> 4: $previousCampNumberB<br>
> produces this result
> 1: 10
> 2: 11
> 3: $previousCampNumber
> 4: 9
> Note that using a minus sign in a #set statement does not work if there are
> no spaces around it. (however, the same is not true for +).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]