There are 3 updates, 3 comments.
 
 
XWiki Platform / cid:jira-generated-image-avatar-e668ccda-5821-4908-88b2-d42b2bfe80e4 XWIKI-24206 Closed

Images in revisions of translated documents not existing in the original fail to be displayed

 
View issue   ยท   Add comment
 

3 updates

 
cid:jira-generated-image-avatar-c3fe61a4-d5e9-4129-a0cc-27773c01d7bf Changes by Vincent Massol on 13/Apr/26 10:40
 
Version: 13.0
Version: 17.10.7
Labels: l10n regression
 
 

3 comments

 
cid:jira-generated-image-avatar-c3fe61a4-d5e9-4129-a0cc-27773c01d7bf Vincent Massol on 13/Apr/26 10:40
 

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.
 
cid:jira-generated-image-avatar-c3fe61a4-d5e9-4129-a0cc-27773c01d7bf 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}
 
cid:jira-generated-image-avatar-c3fe61a4-d5e9-4129-a0cc-27773c01d7bf 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}