FTR Claude code says that this issue was introduced in XWiki 13.0 (January 2021, commit 541a11aadfe, XWIKI-13794).
Here's the chain of causation:
XWIKI-13794 changed the history view so /view/ no longer redirects to /viewrev/. As part of this, createAttachmentURL condition changed from "viewrev".equals(context.getAction()) to context.get("rev") != null. This made the revision-based attachment lookup trigger on all requests with a rev in context โ including translated document history views.
When viewing a translated document's revision, context.getDoc() is the ROOT locale document (set by handleRevision), so the code enters the block, calls findAttachmentForDocRevision(rootLocaleDoc, "translationRevision", ...), which returns null (revision doesn't exist on the ROOT doc), and previously threw NPE, now (with the first fix) silently fell back to the broken viewattachrev URL.
The current fix makes it fall back to the attachment from the current doc state, producing a working downloadrev URL.
Vincent Massol on 13/Apr/26 10:41
FTR Claude code says that this issue was introduced in XWiki 13.0 (January 2021, commit 541a11aadfe, XWIKI-13794). {quote} Here's the chain of causation:
- XWIKI-13794 changed the history view so /view/ no longer redirects to /viewrev/. As part of this, createAttachmentURL condition changed from "viewrev".equals(context.getAction()) to context.get("rev") != null. This made the revision-based attachment lookup trigger on all requests with a rev in context โ including translated document history views. - When viewing a translated document's revision, context.getDoc() is the ROOT locale document (set by handleRevision), so the code enters the block, calls findAttachmentForDocRevision(rootLocaleDoc, "translationRevision", ...), which returns null (revision doesn't exist on the ROOT doc), and previously threw NPE, now (with the first fix) silently fell back to the broken viewattachrev URL. - The current fix makes it fall back to the attachment from the current doc state, producing a working downloadrev URL. {quote}
Vincent Massol on 13/Apr/26 10:42
FTR Claude code says that this issue was introduced in XWiki 13.0 (January 2021, commit 541a11aadfe, XWIKI-13794). {quote}Here's the chain of causation: - XWIKI-13794 changed the history view so /view/ no longer redirects to /viewrev/. As part of this, createAttachmentURL condition changed from "viewrev".equals(context.getAction()) to context.get("rev") != null. This made the revision-based attachment lookup trigger on all requests with a rev in context โ including translated document history views. - When viewing a translated document's revision, context.getDoc() is the ROOT locale document (set by handleRevision), so the code enters the block, calls findAttachmentForDocRevision(rootLocaleDoc, "translationRevision", ...), which returns null (revision doesn't exist on the ROOT doc), and previously threw NPE, now (with the first fix) silently fell back to the broken viewattachrev URL.{quote}
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.