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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to