| The Velocity macro #getBlogCategoriesLocation of Blog.BlogCode sets the variable $postsLocation to null, in addition to setting its own output parameter. A script that includes Blog.BlogCode, gets the posts location of a blog in $postsLocation and then calls #getBlogCategoriesLocation loses the posts location it just computed. No page shipped by the Blog Application is affected today (none keeps $postsLocation across a call to #getBlogCategoriesLocation), but wiki pages and extensions that reuse the blog macros can be. Steps to reproduce Create a page with the following content and view it:
{{include reference="Blog.BlogCode"/}}
{{velocity}}
#getBlogPostsLocation('Blog' $postsLocation)
#getBlogCategoriesLocation('Blog' $categoriesLocation)
Posts: $!postsLocation, categories: $!categoriesLocation
{{/velocity}}
Expected: Posts: Blog, categories: Blog.Categories Actual: Posts: , categories: Blog.Categories Cause BlogCode.xml:1103: #set ($postsLocation = $NULL), copied from #getBlogPostsLocation; it should reset $categoriesLocation, the output parameter of the macro. Found while writing the characterization tests of BLOG-269 (BlogLocationPageTest#getBlogCategoriesLocationClearsThePostsLocationOfTheCaller pins the current behaviour). |