You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Will Glass-Husain (JIRA)" <de...@velocity.apache.org> on 2008/07/13 22:09:31 UTC

[jira] Resolved: (VELOCITY-591) #evaluate directive is wiping out macros

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

Will Glass-Husain resolved VELOCITY-591.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.6

Hi,

Tested this - it works fine.  See the new test EvaluateTestCase.testEvaluateMacroPreserve().

I'm guessing fixes for other bugs took care of this problem.

If you still have problems, reopen.  Ideally modify the test case so it breaks.

> #evaluate directive is wiping out macros
> ----------------------------------------
>
>                 Key: VELOCITY-591
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-591
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6
>         Environment: JDK 1.5
>            Reporter: Jonathan Tew
>            Priority: Critical
>             Fix For: 1.6
>
>
> I think I've found a problem with the new #evaluate directive in 1.6.  It seems like a call to #evaluate is causing the macros that have already been defined to be cleared.  Here is a test template to demonstrate:
> #macro (test $t)
>   test: #evaluate($t)
> #end
> #macro (test2 $t)
>   test2: #evaluate($t)
> #end
> #evaluate("Will Clear Macros")
> #test("hi world 1")
> #test2("hi world 2")
> -------------------------------
> My overall major goal is to have a template be able to render other VTL that is pulled from objects.  The problem with the RenderTool is that it doesn't share the same macros as the parent.  That's why I'm trying to go down the route of using the new #evaluate directive since in theory both the macro and context are shared.

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