Use case: display a list of blog posts from another wiki on the same farm; e.g. list the main wikis blog posts in a subwiki or vice versa. Steps to reproduce:
- have a test wiki with a main wiki and a subwiki
- install the blog app on both wikis (or "install on farm")
- add and publish a new blog post in the main wiki
- in the sub wiki add a page with content
{{blogpostlist blog="xwiki:Blog.WebHome" limit="10"/}}
Expected behavior:
- one can see the blog posts of the main wiki on that page (including the just created one)
actual behavior
- one sees the blog posts from the sub wiki
The reason for the issue is that the blog descriptor is loaded from the main wiki, but then the query to find the blog posts always uses the current wiki. Adding a
$query.setWiki($blogDescriptorDoc.getDocumentReference().getWikiReference().getName())
(when ever the blog parameter is set) shoiuld fix the issue. |