On Jan 19, 2011, at 2:05 PM, sdumitriu (SVN) wrote:
Author: sdumitriu
Date: 2011-01-19 14:05:06 +0100 (Wed, 19 Jan 2011)
New Revision: 33998
Modified:
platform/web/trunk/standard/src/main/webapp/templates/macros.vm
Log:
XWIKI-5890: #setVariableFromRequest doesn't work with Velocity 1.7, replace with
#readVariableFromRequest
Corrected #setVariable so that it doesn't output any whitespace.
Modified: platform/web/trunk/standard/src/main/webapp/templates/macros.vm
===================================================================
--- platform/web/trunk/standard/src/main/webapp/templates/macros.vm 2011-01-19 13:01:30
UTC (rev 33997)
+++ platform/web/trunk/standard/src/main/webapp/templates/macros.vm 2011-01-19 13:05:06
UTC (rev 33998)
@@ -1508,13 +1508,13 @@
* @param value the value to assign
*###
#macro(setVariable $variableName $value)
- ## Only do this if the variable name is really a valid variable name
- #if ($variableName.matches('[a-zA-Z_][a-zA-Z0-9_-]*'))
-
#evaluate("${escapetool.h}set(${escapetool.d}${variableName}=${escapetool.d}value)")
- #elseif ($variableName.matches('\$[a-zA-Z_][a-zA-Z0-9_-]*'))
- #evaluate("${escapetool.h}set(${variableName}=${escapetool.d}value)")
- #end
+## Only do this if the variable name is really a valid variable name
+#if ($variableName.matches('[a-zA-Z_][a-zA-Z0-9_-]*'))
+#evaluate("${escapetool.h}set(${escapetool.d}${variableName}=${escapetool.d}value)")
+#elseif ($variableName.matches('\$[a-zA-Z_][a-zA-Z0-9_-]*'))
+#evaluate("${escapetool.h}set(${variableName}=${escapetool.d}value)")
#end
+#end
So we can't use indentation in macros?
Should we document this generally or is it specific to this macro (in which case maybe we
should add a comment so that the next person doesn't start indenting it)?
Thanks
-Vincent