You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Nathan Bubna (JIRA)" <de...@velocity.apache.org> on 2008/08/15 04:55:44 UTC

[jira] Resolved: (VELOCITY-598) Macros within macros are losing the context

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

Nathan Bubna resolved VELOCITY-598.
-----------------------------------

    Resolution: Duplicate

Ultimately, this is just a duplicate of VELOCITY-62.

> Macros within macros are losing the context
> -------------------------------------------
>
>                 Key: VELOCITY-598
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-598
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.5
>         Environment: velocimacro.permissions.allow.inline.local.scope=true
> velocimacro.permissions.allow.inline=true
> velocimacro.context.localscope=false
> (we can not change this!)
>            Reporter: Jörg Gottschling
>            Priority: Critical
>
> consider the following test code:
> #foreach($num in [1, 2, 3])
>     from loop body: $num
>     #macro(numMacro)$num (numMacro)#end
>     From Macro: #numMacro()
> #end
> it produces correctly:
> from loop body: 1
> From Macro: 1 (numMacro)
> from loop body: 2
> From Macro: 2 (numMacro)
> from loop body: 3
> From Macro: 3 (numMacro)
> But if you wrap this in a macro again, it fails:
> #macro(outerMacro)
>     #foreach($num in [1, 2, 3])
>         from loop body: $num
>         #macro(numMacro)$num (numMacro)#end
>         From Macro: #numMacro()
>     #end
> #end
> #outerMacro()
> output:
> from loop body: 1
> From Macro: $num (numMacro)
> from loop body: 2
> From Macro: $num (numMacro)
> from loop body: 3
> From Macro: $num (numMacro)
> That seams to be a bug for me, when considereing the settings above.

-- 
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