This report actually mixes three different problems, each one now tracked by its own issue:
XWIKI-25805, the cause of the deleted pages: on a sub-wiki, the "Orphan dependencies" step was listing, next to the real orphans, some extensions installed on the root namespace (farm level) which are still needed. That list was computed by a Velocity template which never reset its "orphaned" flag between two extensions, and the extensions installed on root don't set it on a sub-wiki, so they were inheriting the result of the previous extension of the loop. This is also why the list was not the same from one execution to another: it depends on the iteration order. Uninstalling such an extension (Attachment Picker Macro, or PDF Export default API implementation on the second try) from the sub-wiki also uninstalls everything depending on it on that wiki (Attachment Picker Application, XWiki Standard Common Application, XWiki Standard Flavor for sub-wikis and the custom flavor), with all their pages. Ratings Application 16.10.5 is a real orphan. The fix moves the computation to Java (the code deciding whether to display the step was already right): https://github.com/xwiki/xwiki-platform/pull/7523
XWIKI-25806, the error ending the step: NumberProperty#equals was throwing a ClassCastException when compared with a property of another type, which made the comparison of a page with the version provided by the extension fail. The page is kept in that case, so this error did not delete anything. Fixed in 18.10.0RC1, 18.4.9 and 17.10.16.
Until XWIKI-25805 is fixed, the workaround from the description is the way to go: on a sub-wiki, only uninstall the orphans you know are not needed anymore (or none).
This comment was written with the help of Claude (Claude Code).
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.