|
| Summary: |
Migrating the blog categories of another wiki updates the links of the current wiki and misses its blog posts |
| Issue Type: |
Bug |
| Affects Versions: |
9.15.14 |
| Assignee: |
Unassigned |
| Created: |
14/Oct/26 12:12 |
| Priority: |
Minor |
| Reporter: |
Vincent Massol |
| Description: |
$services.blog.migrateCategoryLocation(wikiId) takes the wiki to migrate, but builds part of its references in the current wiki. When it is called for another wiki than the current one (e.g. from the main wiki for a subwiki):
- the links to the default legacy categories (Blog.News, ...) of the current wiki are rewritten to Blog.Categories.News, ..., while those of the migrated wiki are left as they are
- the custom legacy categories of the migrated wiki are moved, but its blog posts and subcategories are not updated, so the posts keep pointing to the old category (Blog.Travel instead of Blog.Categories.Travel)
The UI (Blog.Code.CategoriesLocationMigrator) only migrates the current wiki, so this affects the script API only. Steps to reproduce
- In a subwiki, have a blog post in a legacy category Blog.Travel and a page linking to Blog.News
- From the main wiki, run $services.blog.migrateCategoryLocation('subwiki')
Cause
- CategoryLocationMigration.java:183 resolves the default categories with the current resolver, i.e. in the current wiki, and updateBackLinks then loads the backlinks of these documents
- CategoryLocationMigration.java:278, 309 serialize the category with the compactwiki serializer, relative to the current wiki: subwiki:Blog.Travel doesn't match the Blog.Travel stored in the posts and parents of the subwiki
The current behaviour is pinned by CategoryLocationMigrationTest#migrateAnotherWikiUsesTheReferencesOfTheCurrentWiki (BLOG-269). |
|