This issue has been created
There are 2 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-9db3eade-07e4-4d6c-bea1-93a40375ab76 XWIKI-23544 Open

Wrong doc.getDisplayTitle() when using a sheet

 
View issue   ·   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-91fc03ea-8f70-4e5b-9f93-0296aa260334 Raphaël Jakse created this issue on 19/Sep/25 16:18
 
Summary: Wrong doc.getDisplayTitle() in sheets
Issue Type: cid:jira-generated-image-avatar-9db3eade-07e4-4d6c-bea1-93a40375ab76 Bug
Affects Versions: 17.7.0
Assignee: Unassigned
Attachments: WrongDisplayTitleInSheet.WebHome.xar
Components: Sheet
Created: 19/Sep/25 16:18
Priority: cid:jira-generated-image-static-major-2aafd709-e584-4b6d-9a08-99372de83514 Major
Reporter: Raphaël Jakse
Description:

When displaying a document with a sheet, if the sheet uses doc.displayTitle, the title of the sheet is used, whereas doc.title uses the original document's title. This is inconsistent and displayTitle should probably use the original document's title or name instead

To reproduce:

1. import WrongDisplayTitleInSheet.WebHome.xarlink_attachment_7.gif
2. Visit http://localhost:8080/xwiki/bin/view/WrongDisplayTitleInSheet/?sheet=WrongDisplayTitleInSheet.WrongDisplayTitleSheet

Expected:

The page shows "Display Title: WrongDisplayTitleSheet: handling"

Actual:

The page shows "Display Title: WrongDisplayTitleInSheet Home"

(Imperfect) workaround:

$stringtool.firstNonBlank($doc.title, $doc.name.replaceAll("^WebHome$", ""), $doc.documentReference.parent.name).trim()

 
 

2 updates

 
cid:jira-generated-image-avatar-91fc03ea-8f70-4e5b-9f93-0296aa260334 Changes by Raphaël Jakse on 19/Sep/25 16:24
 
Summary: Wrong doc.getDisplayTitle() in sheets when using a sheet
Description: When displaying a document with a sheet, if the sheet uses doc.displayTitle , renders the the title of the sheet is used instead of the original document , whereas doc.title uses the original document's title (for instance in the sheet title, the sheet content and the navigation panel) . This is inconsistent and displayTitle should probably use the original document's title or name instead

To reproduce:

1. import [^WrongDisplayTitleInSheet.WebHome.xar]
2. Visit [http://localhost:8080/xwiki/bin/view/WrongDisplayTitleInSheet/?sheet=WrongDisplayTitleInSheet.WrongDisplayTitleSheet]

Expected:

The page shows "Display Title: WrongDisplayTitleSheet: handling"

Actual:

The page shows "Display Title: WrongDisplayTitleInSheet Home"

(Imperfect) workaround:

{{$stringtool.firstNonBlank($doc.title, $doc.name.replaceAll("^WebHome$", ""), $doc.documentReference.parent.name).trim()}}