Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-682

#evaluate breaks macro processing

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.1
    • 1.6.2, 1.7
    • Engine
    • None

    Description

      When using #evaluate, all further macro processing is broken; old macros are not recognized anymore, and new macros cannot be defined.

      For example:

      #macro(aSimpleMacro)
        This is a simple macro
      #end
      ## called 3 times to show that it works each time
      #aSimpleMacro()
      #aSimpleMacro()
      #aSimpleMacro()
      
      #macro(doEval $b)
        #evaluate($x)
      
      #end
      
      #set($x = 'value of x')
      #doEval('$x')
      ## after the first call, which used an #evaluate, these two won't work anymore:
      #doEval('$x')
      #doEval('$x')
      
      #macro(anotherSimpleMacro)
        This is another simple macro
      #end
      ## This newly defined macro doesn't work, either...
      #anotherSimpleMacro()
      
      ## And the first macro, which worked well before, suddenly stops working
      #aSimpleMacro()
      {/noformat}
      
      should print:
      
      

      This is a simple macro
      This is a simple macro
      This is a simple macro

      value of x
      value of x
      value of x

      This is another simple macro

      This is a simple macro

      {/noformat}

      but instead prints:
      
      

      This is a simple macro
      This is a simple macro
      This is a simple macro

      value of x
      #doEval('$x')
      #doEval('$x')

      #anotherSimpleMacro()

      #aSimpleMacro(){/noformat}

      Attachments

        Activity

          People

            Unassigned Unassigned
            sdumitriu Sergiu Dumitriu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: