This issue has been created
There is 1 update.
 
 
Blog Application / cid:jira-generated-image-avatar-d6caafe7-fb83-42fe-bbee-8fd2f5d98473 BLOG-278 Open

Getting the categories location of a blog clears the posts location computed by the calling script

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-5added3c-0484-44ca-8a1a-10ea91b7e19d Vincent Massol created this issue on 14/Oct/26 12:21
 
Summary: Getting the categories location of a blog clears the posts location computed by the calling script
Issue Type: cid:jira-generated-image-avatar-d6caafe7-fb83-42fe-bbee-8fd2f5d98473 Bug
Affects Versions: 9.15.14
Assignee: Unassigned
Created: 14/Oct/26 12:21
Priority: cid:jira-generated-image-static-major-848ae931-7a7a-43d0-a7fc-8b49ac0b9602 Major
Reporter: Vincent Massol
Description:

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

 
 

1 update

 
cid:jira-generated-image-avatar-5added3c-0484-44ca-8a1a-10ea91b7e19d Changes by Vincent Massol on 14/Oct/26 12:21
 
Assignee: Vincent Massol