Affects Version/s: 3.5, 4.0-rc-1
Fix Version/s: None
Component/s: Old Core
To reproduce, in a multiwiki instance:
- create a subwiki (I used WikiManager.CreateNewWiki but I don't think workspaces changes anything)
- delete it
- re-create the same subwiki: you won't be able to complete, you'll get an error.
The exception is something like this
and in the logs there is something like this
This is caused because the subwiki database schema is not initialized, so initializeXWikiClasses() which is done upon creation of the subwiki, is trying to get a table which doesn't exist.
The reason for which the subwiki schema is not initialized is because, in the function
, where a new database should be initialized, the newly re-created wiki fails to be seen as new database, because of the database version cache. The function com.xpn.xwiki.store.migration.AbstractDataMigrationManager.getDBVersion() will get the version of the wikitemplate database from the cache, and will think it's great and up to date. The fix would be to clear this cache when a subwiki is deleted.
Note that, of course, since this it's a cache issue, a server restart between the delete and the re-create will work perfectly fine as a workaround.