From: Marc P. <ma...@an...> - 2005-08-05 10:46:46
|
Hi, I've hit upon what I believe is an obscure bug in #eval/#templet in 2.0 RC1. I'm finding it with my JSP taglib but I don't believe it is specific to the taglib, it smells more like a problem with #templet/eval. Of course a unit test will prove this so that will naturally be my next course of action. However I can't commit to WM from my workplace. ...evaluating this template: <html> <body> #templet $render Value is: $value #end #templet $outerTemplet #set $value = "Hello!" #eval $rendertemplet using { "value" : $value } #end #eval $outerTemplet using { "rendertemplet" : $render } </body> </html> ...the intention/expectation is that this will simply output: <html> <body> Value is: Hello! </body> </html> ...but, rather weirdly, you get this: <html> <body> Value is: <!-- Attempted to write an undefined variable: Hello! at render:4.11 --> </body> </html> Notice that it says undefined variable "Hello!" - but that is the value of the variable! It's like it's trying to recursively evaluate it. Keats - any thoughts? I will try to dig into the source and write a unit test for this, but I wanted to flag it in case I'm being stupid. Also, there seems to be an error handling bug. If your innermost templet references a non-existent variable, you get something like: Value is: <!-- Attempted to write an undefined variable: <!-- Attempted to write an undefined variable: $iknowthisdoesntexistvalue at unknown:2.58 --> at render:4.11 --> ...notice that this has two error messages and unbalanced "-->" so you get some nasty output in the page and interestingly two sources - unknown and render. Also note that it gets the error variable name right in this case, but in the first problem I talked about it uses the -value- of the variable as the "unknown" variable name. Very confusing! Cheers |