Branch: refs/heads/master Home: https://github.com/xwiki/xwiki-platform Commit: 488bd04a7afcf4ed043d1e2a61c0ce8c7d831470 https://github.com/xwiki/xwiki-platform/commit/488bd04a7afcf4ed043d1e2a61c0c... Author: Aly Serry <[email protected]> Date: 2026-08-12 (Wed, 12 Aug 2026) Changed paths: M xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-api/src/main/java/org/xwiki/attachment/internal/refactoring/job/MoveAttachmentJob.java M xwiki-platform-core/xwiki-platform-attachment/xwiki-platform-attachment-api/src/test/java/org/xwiki/attachment/internal/refactoring/job/MoveAttachmentJobTest.java Log Message: ----------- XWIKI-24685: When the move of an attachment fails, a redirection to an attachment that was never created is left behind (#6148) Remove the redirection added to the source document before the rollback branch of transactionalMove re-saves it, since at that point it points to a target attachment that was never created. Reuse AttachmentsManager#removeExistingRedirection, already used elsewhere in the same class, instead of introducing a new way to remove the object. Only do so when autoRedirect is true, i.e. when the job actually added a redirection to remove; otherwise this could remove an unrelated, pre-existing redirection for that attachment name. Fix the assertion in MoveAttachmentJobTest#processTargetSaveFail that expected the redirection to still be present after the rollback, and add a test for a failed move with auto-redirect disabled, asserting that nothing is removed in that case. To unsubscribe from these emails, change your notification settings at https://github.com/xwiki/xwiki-platform/settings/notifications