velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claude Brisson (JIRA)" <...@velocity.apache.org>
Subject [jira] Issue Comment Edited: (VELOCITY-681) [regression] Changes on the macro parameters are not persisted outside the macro call
Date Tue, 03 Feb 2009 00:47:59 GMT

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

claude edited comment on VELOCITY-681 at 2/2/09 4:47 PM:
-----------------------------------------------------------------

Ok, I try to summarize.

Prior to 1.6.1, the behaviour of the ProxyVM was ok. That is:

  #macro(populate $foo)#set($foo='hello')#end
  #populate($bar)

would affect $bar and not $foo (or nothing at all, depending on the localscope setting) as
1.6.1 is doing.

I'm not using such settings from inside macros myself, but I'm pretty sure users have, so
I think like Byron that we should take this issue seriously and resolve it before pushing
1.6.2 out.

I took a look at commit 724498, and I don't understand why the previous put method was so
drastically reduced. I think we should fix the fix rather than applying Sergiu's patch (nothing
personal, Sergiu!).


      was (Author: claude):
    Ok, I try to summarize.

Prior to 1.6.1, the behaviour of the ProxyVM was ok. That is:

  #macro(populate $foo)#set($foo='hello')#end
  #populate($bar)

would affect $bar and not $foo (or nothing at all, depending on the localscope setting) as
1.6.1 is doing.

I'm not using such settings from inside macros myself, but I'm pretty sure users have, so
I think like Byron that we should take this issue seriously and resolve it before pushing
1.6.1 out.

I took a look at commit 724498, and I don't understand why the previous put method was so
drastically reduced. I think we should fix the fix rather than applying Sergiu's patch (nothing
personal, Sergiu!).

  
> [regression] Changes on the macro parameters are not persisted outside the macro call
> -------------------------------------------------------------------------------------
>
>                 Key: VELOCITY-681
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-681
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6.1
>            Reporter: Sergiu Dumitriu
>            Priority: Critical
>             Fix For: 1.6.2, 1.7
>
>         Attachments: VELOCITY-681-1.6.patch, VELOCITY-681-trunk.patch
>
>
> The fix for VELOCITY-615 was too radical, since it completely disables #setting new values
to the formal arguments. A minimalistic example that used to work up to 1.6 (but not with
1.6.1) is:
> {noformat}
> #macro(myMacro $result)
>   #set($result = 'some value')
> #end
> #myMacro($x)
> $x
> {/noformat}
> which prints $x (as an undefined variable).

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


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


Mime
View raw message