| A blog created from Blog.Management has a categories home page (e.g. MyBlog.Categories.WebHome) displayed with Blog.CategoriesSheet through a XWiki.DocumentSheetBinding object. The blog code doesn't recognize that page as a categories home page. Steps to reproduce
- Create a blog MyBlog from Blog.Management, with its panels.
- Publish a post in the category MyBlog.Categories.Personal.
- Open the categories home page of the blog, MyBlog.Categories.WebHome.
- Open its RSS feed (MyBlog/Categories/?xpage=plain&sheet=Blog.CategoryRss).
Expected
- The page lists the categorized posts of the blog.
- The "Blog Categories" panel shows the categories of MyBlog.
- The feed is about the categories of MyBlog.
Actual
- The page lists no post.
- The "Blog Categories" panel shows the categories of the default blog (Blog.Categories), and the "Related Blogs" panel the blogs related to the default blog.
- The feed is the feed of the categories of the default blog (Blog/Categories/).
Cause The categories home page is detected with $doc.getObject('XWiki.DocumentSheetBinding').sheet == 'Blog.CategoriesSheet'. $object.sheet returns the displayed value of the sheet property (a page property), not its raw value, so the comparison is always false. Same check in BlogParameters.xml:71 ($isCategoriesHomePage, used by the panels), CategoriesCode.xml:585 (#displayCategoryPosts), CategoryRss.xml:69, BlogCode.xml:1133 and 1197, ArchiveSheet.xml:175 and 193. getValue('sheet') returns the expected value. Pinned by the functional test BlogLocationIT#categoriesOfTheBlogs (BLOG-269). |