Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-23544

Wrong doc.getDisplayTitle() when using a sheet

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 17.7.0
    • Sheet
    • None
    • Unknown

    Description

      When displaying a document with a sheet, doc.displayTitle renders the the title of the sheet 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()

      Attachments

        Activity

          People

            Unassigned Unassigned
            rjakse Raphaël Jakse
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: